Changeset 148294 in webkit
- Timestamp:
- Apr 12, 2013 11:57:38 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 4 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148291 r148294 1 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Split GtkAuthenticationDialog in two widgets 4 https://bugs.webkit.org/show_bug.cgi?id=103644 5 6 Reviewed by Xan Lopez. 7 8 The current GtkAuthenticationDialog implements both the common 9 logic and widgets to implement a real GtkDialog and a widget to be 10 embedded in any container. WebKit1 uses a GtkDialog while WebKit2 11 embeds the dialog in the WebView. This patch splits the code to 12 leave in Platform only the code that is actually common, leaving 13 the widget implementation to the WebKit layer, using a dialog in 14 WebKit1 and embedding auth widget in the WebView in WebKit2. 15 16 * GNUmakefile.list.am: Add new files to compilation. 17 * platform/gtk/GtkAuthenticationDialog.cpp: Removed. 18 * platform/gtk/GtkAuthenticationDialog.h: Removed. 19 * platform/gtk/WebKitAuthenticationWidget.cpp: Added. 20 (_WebKitAuthenticationWidgetPrivate): 21 (packTwoColumnLayoutInBox): 22 (createLabel): 23 (createEntry): 24 (webkitAuthenticationWidgetInitialize): 25 (webkitAuthenticationWidgetFinalize): 26 (webkit_authentication_widget_init): 27 (webkit_authentication_widget_class_init): 28 (webkitAuthenticationWidgetNew): 29 (webkitAuthenticationWidgetCreateCredential): 30 (webkitAuthenticationWidgetGetChallenge): 31 * platform/gtk/WebKitAuthenticationWidget.h: Added. 32 (_WebKitAuthenticationWidget): 33 (_WebKitAuthenticationWidgetClass): 34 1 35 2013-04-11 Jer Noble <jer.noble@apple.com> 2 36 -
trunk/Source/WebCore/GNUmakefile.list.am
r148265 r148294 6225 6225 Source/WebCore/platform/gtk/GRefPtrGtk.cpp \ 6226 6226 Source/WebCore/platform/gtk/GRefPtrGtk.h \ 6227 Source/WebCore/platform/gtk/GtkAuthenticationDialog.cpp \6228 Source/WebCore/platform/gtk/GtkAuthenticationDialog.h \6229 6227 Source/WebCore/platform/gtk/GtkClickCounter.cpp \ 6230 6228 Source/WebCore/platform/gtk/GtkClickCounter.h \ … … 6257 6255 Source/WebCore/platform/gtk/UserAgentGtk.cpp \ 6258 6256 Source/WebCore/platform/gtk/UserAgentGtk.h \ 6257 Source/WebCore/platform/gtk/WebKitAuthenticationWidget.cpp \ 6258 Source/WebCore/platform/gtk/WebKitAuthenticationWidget.h \ 6259 6259 Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp \ 6260 6260 Source/WebCore/platform/graphics/gtk/ColorGtk.cpp \ -
trunk/Source/WebCore/platform/gtk/po/POTFILES.in
r145936 r148294 1 1 # List of source files which contain translatable strings. 2 2 ErrorsGtk.cpp 3 GtkAuthenticationDialog.cpp4 3 LocalizedStringsGtk.cpp 4 WebKitAuthenticationWidget.cpp 5 5 ../graphics/gtk/FullscreenVideoControllerGtk.cpp 6 6 ../../../WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp -
trunk/Source/WebKit/gtk/ChangeLog
r148159 r148294 1 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Split GtkAuthenticationDialog in two widgets 4 https://bugs.webkit.org/show_bug.cgi?id=103644 5 6 Reviewed by Xan Lopez. 7 8 * GNUmakefile.am: Add new files to compilation. 9 * WebCoreSupport/FrameLoaderClientGtk.cpp: 10 (WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge): 11 Use helper createAuthenticationDialog() to create and show the 12 auth dialog. 13 * webkit/webkitauthenticationdialog.cpp: Added. 14 (authenticationDialogResponseCallback): 15 (createAuthenticationDialog): 16 * webkit/webkitauthenticationdialog.h: Added. 17 * webkit/webkitsoupauthdialog.cpp: 18 (sessionAuthenticate): Ditto. 19 1 20 2013-04-10 Benjamin Poulain <bpoulain@apple.com> 2 21 -
trunk/Source/WebKit/gtk/GNUmakefile.am
r147137 r148294 231 231 Source/WebKit/gtk/WebCoreSupport/WebViewInputMethodFilter.h \ 232 232 Source/WebKit/gtk/webkit/webkitapplicationcache.cpp \ 233 Source/WebKit/gtk/webkit/webkitauthenticationdialog.cpp \ 234 Source/WebKit/gtk/webkit/webkitauthenticationdialog.h \ 233 235 Source/WebKit/gtk/webkit/webkitdownload.cpp \ 234 236 Source/WebKit/gtk/webkit/webkitdownloadprivate.h \ -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r145914 r148294 41 41 #include "FrameTree.h" 42 42 #include "FrameView.h" 43 #include "GtkAuthenticationDialog.h"44 43 #include "GtkPluginWidget.h" 45 44 #include "GtkUtilities.h" … … 66 65 #include "ScriptController.h" 67 66 #include "Settings.h" 67 #include "webkitauthenticationdialog.h" 68 68 #include "webkiterror.h" 69 69 #include "webkitfavicondatabase.h" … … 206 206 207 207 WebKitWebView* view = webkit_web_frame_get_web_view(m_frame); 208 GtkAuthenticationDialog::CredentialStorageMode credentialStorageMode; 209 208 209 CredentialStorageMode credentialStorageMode; 210 210 if (core(view)->settings()->privateBrowsingEnabled()) 211 credentialStorageMode = GtkAuthenticationDialog::DisallowPersistentStorage;211 credentialStorageMode = DisallowPersistentStorage; 212 212 else 213 credentialStorageMode = GtkAuthenticationDialog::AllowPersistentStorage;213 credentialStorageMode = AllowPersistentStorage; 214 214 215 215 GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(view)); 216 GtkWindow* toplevelWindow = widgetIsOnscreenToplevelWindow(toplevel) ? GTK_WINDOW(toplevel) : 0; 217 GtkAuthenticationDialog* dialog = new GtkAuthenticationDialog(toplevelWindow, challenge, credentialStorageMode); 218 dialog->show(); 216 GtkWidget* authDialog = createAuthenticationDialog(widgetIsOnscreenToplevelWindow(toplevel) ? GTK_WINDOW(toplevel) : 0, challenge, credentialStorageMode); 217 gtk_widget_show(authDialog); 219 218 } 220 219 -
trunk/Source/WebKit/gtk/webkit/webkitsoupauthdialog.cpp
r145722 r148294 22 22 23 23 #include "AuthenticationClient.h" 24 #include "GtkAuthenticationDialog.h"25 24 #include "ResourceHandle.h" 25 #include "webkitauthenticationdialog.h" 26 26 #include "webkitmarshal.h" 27 #include <wtf/text/CString.h> 27 28 28 29 using namespace WebCore; … … 143 144 client->derefWebKitSoupAuthDialogAuthenticationClient(); 144 145 145 Gtk AuthenticationDialog* authDialog = new GtkAuthenticationDialog(toplevel, challenge, GtkAuthenticationDialog::DisallowPersistentStorage);146 authDialog->show();146 GtkWidget* authDialog = createAuthenticationDialog(toplevel, challenge, DisallowPersistentStorage); 147 gtk_widget_show(authDialog); 147 148 } 148 149 -
trunk/Source/WebKit2/ChangeLog
r148286 r148294 1 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Split GtkAuthenticationDialog in two widgets 4 https://bugs.webkit.org/show_bug.cgi?id=103644 5 6 Reviewed by Xan Lopez. 7 8 * GNUmakefile.list.am: Add new files to compilation. 9 * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.cpp: Removed. 10 * UIProcess/API/gtk/WebKit2GtkAuthenticationDialog.h: Removed. 11 * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: Added. 12 (webkitAuthenticationDialogAuthenticate): Use the 13 AuthenticationChallengeProxy to authenticate and destroy the dialog. 14 (okButtonClicked): Call webkitAuthenticationDialogAuthenticate() 15 with the credential. 16 (cancelButtonClicked): Call 17 webkitAuthenticationDialogAuthenticate() with a NULL credential to 18 continue without credential. 19 (webkitAuthenticationDialogInitialize): Build the UI. 20 (webkitAuthenticationDialogDraw): Draw a background. 21 (webkitAuthenticationDialogMap): Grab default button. 22 (webkitAuthenticationDialogConstructed): Create a GtkStyleContext 23 with the GtkWindow path to draw the widget background like a real 24 dialog. 25 (webkit_authentication_dialog_class_init): 26 (webkitAuthenticationDialogNew): Create a new 27 WebKitAuthenticationDialog widget. 28 * UIProcess/API/gtk/WebKitAuthenticationDialog.h: Added. 29 * UIProcess/API/gtk/WebKitLoaderClient.cpp: 30 * UIProcess/API/gtk/WebKitWebView.cpp: 31 (webkitWebViewHandleAuthenticationChallenge): Create a 32 WebKitAuthenticationDialog widget and pass add it to the 33 container. 34 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 35 (_WebKitWebViewBasePrivate): Updated to use the widget directly. 36 (webkitWebViewChildIsInternalWidget): Ditto. 37 (webkitWebViewBaseAddAuthenticationDialog): Ditto. 38 (webkitWebViewBaseCancelAuthenticationDialog): Ditto. 39 (webkitWebViewBaseContainerRemove): Ditto. 40 (webkitWebViewBaseContainerForall): Ditto. 41 (resizeWebKitWebViewBaseFromAllocation): Ditto. 42 (webkitWebViewBaseFocus): Ditto. 43 (webkitWebViewBaseDestroy): Destroy the auth widget is present. 44 (webkit_web_view_base_class_init): Add implementation for 45 GtkWidgetClass::destroy. 46 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: 47 1 48 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 49 -
trunk/Source/WebKit2/GNUmakefile.list.am
r148176 r148294 648 648 Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \ 649 649 Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \ 650 Source/WebKit2/UIProcess/API/gtk/WebKit 2GtkAuthenticationDialog.cpp \651 Source/WebKit2/UIProcess/API/gtk/WebKit 2GtkAuthenticationDialog.h \650 Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationDialog.cpp \ 651 Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationDialog.h \ 652 652 Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.h \ 653 653 Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp \ -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp
r147725 r148294 22 22 #include "WebKitLoaderClient.h" 23 23 24 #include "WebKit2GtkAuthenticationDialog.h"25 24 #include "WebKitBackForwardListPrivate.h" 26 25 #include "WebKitURIResponsePrivate.h" -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r145202 r148294 27 27 #include "WebContextMenuItemData.h" 28 28 #include "WebData.h" 29 #include "WebKitAuthenticationDialog.h" 29 30 #include "WebKitBackForwardListPrivate.h" 30 31 #include "WebKitContextMenuClient.h" … … 1667 1668 void webkitWebViewHandleAuthenticationChallenge(WebKitWebView* webView, AuthenticationChallengeProxy* authenticationChallenge) 1668 1669 { 1669 WebKit2GtkAuthenticationDialog* dialog; 1670 GtkAuthenticationDialog::CredentialStorageMode credentialStorageMode; 1671 1670 CredentialStorageMode credentialStorageMode; 1672 1671 if (webkit_settings_get_enable_private_browsing(webView->priv->settings.get())) 1673 credentialStorageMode = GtkAuthenticationDialog::DisallowPersistentStorage;1672 credentialStorageMode = DisallowPersistentStorage; 1674 1673 else 1675 credentialStorageMode = GtkAuthenticationDialog::AllowPersistentStorage; 1676 1677 dialog = new WebKit2GtkAuthenticationDialog(authenticationChallenge, credentialStorageMode); 1678 webkitWebViewBaseAddAuthenticationDialog(WEBKIT_WEB_VIEW_BASE(webView), dialog); 1679 dialog->show(); 1674 credentialStorageMode = AllowPersistentStorage; 1675 1676 webkitWebViewBaseAddAuthenticationDialog(WEBKIT_WEB_VIEW_BASE(webView), webkitAuthenticationDialogNew(authenticationChallenge, credentialStorageMode)); 1680 1677 } 1681 1678 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r147137 r148294 37 37 #include "WebFullScreenClientGtk.h" 38 38 #include "WebInspectorProxy.h" 39 #include "WebKitAuthenticationDialog.h" 39 40 #include "WebKitPrivate.h" 40 41 #include "WebKitWebViewBaseAccessible.h" … … 105 106 GRefPtr<AtkObject> accessible; 106 107 bool needsResizeOnMap; 107 WebKit2GtkAuthenticationDialog* authenticationDialog;108 GtkWidget* authenticationDialog; 108 109 GtkWidget* inspectorView; 109 110 unsigned inspectorViewHeight; … … 273 274 { 274 275 WebKitWebViewBasePrivate* priv = webViewBase->priv; 275 return widget == priv->inspectorView || (priv->authenticationDialog && priv->authenticationDialog->widget() == widget);276 return widget == priv->inspectorView || widget == priv->authenticationDialog; 276 277 } 277 278 … … 292 293 } 293 294 294 void webkitWebViewBaseAddAuthenticationDialog(WebKitWebViewBase* webViewBase, WebKit2GtkAuthenticationDialog* dialog) 295 { 296 webViewBase->priv->authenticationDialog = dialog; 297 gtk_container_add(GTK_CONTAINER(webViewBase), dialog->widget()); 298 gtk_widget_queue_draw(GTK_WIDGET(webViewBase)); // We need to draw the shadow over the widget. 295 void webkitWebViewBaseAddAuthenticationDialog(WebKitWebViewBase* webViewBase, GtkWidget* dialog) 296 { 297 WebKitWebViewBasePrivate* priv = webViewBase->priv; 298 priv->authenticationDialog = dialog; 299 gtk_container_add(GTK_CONTAINER(webViewBase), dialog); 300 gtk_widget_show(dialog); 301 302 // We need to draw the shadow over the widget. 303 gtk_widget_queue_draw(GTK_WIDGET(webViewBase)); 299 304 } 300 305 … … 303 308 WebKitWebViewBasePrivate* priv = webViewBase->priv; 304 309 if (priv->authenticationDialog) 305 priv->authenticationDialog->destroy();310 gtk_widget_destroy(priv->authenticationDialog); 306 311 } 307 312 … … 324 329 priv->inspectorView = 0; 325 330 priv->inspectorViewHeight = 0; 326 } else if (priv->authenticationDialog && priv->authenticationDialog->widget()== widget) {331 } else if (priv->authenticationDialog == widget) { 327 332 priv->authenticationDialog = 0; 328 333 } else { … … 348 353 349 354 if (includeInternals && priv->authenticationDialog) 350 (*callback)(priv->authenticationDialog ->widget(), callbackData);355 (*callback)(priv->authenticationDialog, callbackData); 351 356 } 352 357 … … 474 479 if (priv->authenticationDialog) { 475 480 GtkRequisition naturalSize; 476 gtk_widget_get_preferred_size(priv->authenticationDialog ->widget(), 0, &naturalSize);481 gtk_widget_get_preferred_size(priv->authenticationDialog, 0, &naturalSize); 477 482 478 483 GtkAllocation childAllocation = { … … 482 487 naturalSize.height 483 488 }; 484 gtk_widget_size_allocate(priv->authenticationDialog ->widget(), &childAllocation);489 gtk_widget_size_allocate(priv->authenticationDialog, &childAllocation); 485 490 } 486 491 … … 818 823 if (priv->authenticationDialog) { 819 824 gboolean returnValue; 820 g_signal_emit_by_name(priv->authenticationDialog ->widget(), "focus", direction, &returnValue);825 g_signal_emit_by_name(priv->authenticationDialog, "focus", direction, &returnValue); 821 826 return returnValue; 822 827 } 823 828 824 829 return GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->focus(widget, direction); 830 } 831 832 static void webkitWebViewBaseDestroy(GtkWidget* widget) 833 { 834 WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)->priv; 835 if (priv->authenticationDialog) 836 gtk_widget_destroy(priv->authenticationDialog); 837 838 GTK_WIDGET_CLASS(webkit_web_view_base_parent_class)->destroy(widget); 825 839 } 826 840 … … 851 865 widgetClass->get_accessible = webkitWebViewBaseGetAccessible; 852 866 widgetClass->parent_set = webkitWebViewBaseParentSet; 867 widgetClass->destroy = webkitWebViewBaseDestroy; 853 868 854 869 GObjectClass* gobjectClass = G_OBJECT_CLASS(webkitWebViewBaseClass); -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
r138544 r148294 30 30 31 31 #include "WebContextMenuProxyGtk.h" 32 #include "WebKit2GtkAuthenticationDialog.h"33 32 #include "WebKitPrivate.h" 34 33 #include "WebKitWebViewBase.h" … … 68 67 void webkitWebViewBaseHandleDownloadRequest(WebKitWebViewBase*, WebKit::DownloadProxy*); 69 68 70 void webkitWebViewBaseAddAuthenticationDialog(WebKitWebViewBase*, WebKit::WebKit2GtkAuthenticationDialog*);69 void webkitWebViewBaseAddAuthenticationDialog(WebKitWebViewBase*, GtkWidget* authDialog); 71 70 void webkitWebViewBaseCancelAuthenticationDialog(WebKitWebViewBase*); 72 71 void webkitWebViewBaseAddWebInspector(WebKitWebViewBase*, GtkWidget* inspector); -
trunk/Tools/ChangeLog
r148292 r148294 1 2013-04-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Split GtkAuthenticationDialog in two widgets 4 https://bugs.webkit.org/show_bug.cgi?id=103644 5 6 Reviewed by Xan Lopez. 7 8 * gtk/generate-gtkdoc: 9 (get_webkit2_options): Do not generate api docs for 10 WebKitAuthenticationDialog which is private in WebKit2. 11 (get_webkit1_options): Do not generate api docs for 12 webkitauthenticationdialog which is private in WebKit1. 13 1 14 2013-04-12 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/Tools/gtk/generate-gtkdoc
r142394 r148294 101 101 glob.glob(injected_bundle_src_path('*Private.h')) + \ 102 102 glob.glob(src_path('*Client*')) + \ 103 glob.glob(src_path('WebKit2GtkAuthenticationDialog.*')) + \104 103 glob.glob(src_path('WebKitGeolocationProvider.*')) + \ 105 104 glob.glob(src_path('WebKitTextChecker.*')) + \ 105 glob.glob(src_path('WebKitAuthenticationDialog.*')) + \ 106 106 glob.glob(src_path('WebKitWebViewBaseAccessible.*')) + \ 107 107 glob.glob(src_path('WebViewBaseInputMethodFilter.*')) + \ … … 139 139 'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps), 140 140 'ignored_files': glob.glob(src_path('webkit', '*private.*')) + \ 141 glob.glob(src_path('webkit', 'webkitauthenticationdialog.*')) + \ 141 142 glob.glob(src_path('webkit', 'webkitspellcheckerenchant.*')) 142 143 })
Note: See TracChangeset
for help on using the changeset viewer.