-
carlosgc@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=103644 Reviewed by Xan Lopez. Source/WebCore: The current GtkAuthenticationDialog implements both the common logic and widgets to implement a real GtkDialog and a widget to be embedded in any container. WebKit1 uses a GtkDialog while WebKit2 embeds the dialog in the WebView. This patch splits the code to leave in Platform only the code that is actually common, leaving the widget implementation to the WebKit layer, using a dialog in WebKit1 and embedding auth widget in the WebView in WebKit2. * GNUmakefile.list.am: Add new files to compilation. * platform/gtk/GtkAuthenticationDialog.cpp: Removed. * platform/gtk/GtkAuthenticationDialog.h: Removed. * platform/gtk/WebKitAuthenticationWidget.cpp: Added. (_WebKitAuthenticationWidgetPrivate): (packTwoColumnLayoutInBox): (createLabel): (createEntry): (webkitAuthenticationWidgetInitialize): (webkitAuthenticationWidgetFinalize): (webkit_authentication_widget_init): (webkit_authentication_widget_class_init): (webkitAuthenticationWidgetNew): (webkitAuthenticationWidgetCreateCredential): (webkitAuthenticationWidgetGetChallenge): * platform/gtk/WebKitAuthenticationWidget.h: Added. (_WebKitAuthenticationWidget): (_WebKitAuthenticationWidgetClass): Source/WebKit/gtk: * GNUmakefile.am: Add new files to compilation. * WebCoreSupport/FrameLoaderClientGtk.cpp: (WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): Use helper createAuthenticationDialog() to create and show the auth dialog. * webkit/webkitauthenticationdialog.cpp: Added. (authenticationDialogResponseCallback): (createAuthenticationDialog): * webkit/webkitauthenticationdialog.h: Added. * webkit/webkitsoupauthdialog.cpp: (sessionAuthenticate): Ditto. Source/WebKit2: * GNUmakefile.list.am: Add new files to compilation. * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp: Removed. * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.h: Removed. * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: Added. (webkitAuthenticationDialogAuthenticate): Use the AuthenticationChallengeProxy to authenticate and destroy the dialog. (okButtonClicked): Call webkitAuthenticationDialogAuthenticate() with the credential. (cancelButtonClicked): Call webkitAuthenticationDialogAuthenticate() with a NULL credential to continue without credential. (webkitAuthenticationDialogInitialize): Build the UI. (webkitAuthenticationDialogDraw): Draw a background. (webkitAuthenticationDialogMap): Grab default button. (webkitAuthenticationDialogConstructed): Create a GtkStyleContext with the GtkWindow path to draw the widget background like a real dialog. (webkit_authentication_dialog_class_init): (webkitAuthenticationDialogNew): Create a new WebKitAuthenticationDialog widget. * UIProcess/API/gtk/WebKitAuthenticationDialog.h: Added. * UIProcess/API/gtk/WebKitLoaderClient.cpp: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewHandleAuthenticationChallenge): Create a WebKitAuthenticationDialog widget and pass add it to the container. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (_WebKitWebViewBasePrivate): Updated to use the widget directly. (webkitWebViewChildIsInternalWidget): Ditto. (webkitWebViewBaseAddAuthenticationDialog): Ditto. (webkitWebViewBaseCancelAuthenticationDialog): Ditto. (webkitWebViewBaseContainerRemove): Ditto. (webkitWebViewBaseContainerForall): Ditto. (resizeWebKitWebViewBaseFromAllocation): Ditto. (webkitWebViewBaseFocus): Ditto. (webkitWebViewBaseDestroy): Destroy the auth widget is present. (webkit_web_view_base_class_init): Add implementation for GtkWidgetClass::destroy. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Tools: * gtk/generate-gtkdoc: (get_webkit2_options): Do not generate api docs for WebKitAuthenticationDialog which is private in WebKit2. (get_webkit1_options): Do not generate api docs for webkitauthenticationdialog which is private in WebKit1. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
f3e04808