diff options
Diffstat (limited to 'Source/WebKit/gtk/webkit')
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitglobals.cpp | 6 | ||||
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebinspector.cpp | 39 | ||||
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h | 4 | ||||
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebsettings.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebview.cpp | 82 | ||||
-rw-r--r-- | Source/WebKit/gtk/webkit/webkitwebview.h | 4 |
6 files changed, 80 insertions, 57 deletions
diff --git a/Source/WebKit/gtk/webkit/webkitglobals.cpp b/Source/WebKit/gtk/webkit/webkitglobals.cpp index 3967c6376..bc5d72604 100644 --- a/Source/WebKit/gtk/webkit/webkitglobals.cpp +++ b/Source/WebKit/gtk/webkit/webkitglobals.cpp @@ -336,12 +336,6 @@ void webkitInit() soup_session_add_feature(session, authDialog); g_object_unref(authDialog); - SoupSessionFeature* sniffer = static_cast<SoupSessionFeature*>(g_object_new(SOUP_TYPE_CONTENT_SNIFFER, NULL)); - soup_session_add_feature(session, sniffer); - g_object_unref(sniffer); - - soup_session_add_feature_by_type(session, SOUP_TYPE_CONTENT_DECODER); - #if USE(CLUTTER) gtk_clutter_init(0, 0); #endif diff --git a/Source/WebKit/gtk/webkit/webkitwebinspector.cpp b/Source/WebKit/gtk/webkit/webkitwebinspector.cpp index c93c2bdb2..692079f68 100644 --- a/Source/WebKit/gtk/webkit/webkitwebinspector.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebinspector.cpp @@ -577,42 +577,3 @@ void webkit_web_inspector_execute_script(WebKitWebInspector* webInspector, long WebKitWebInspectorPrivate* priv = webInspector->priv; priv->page->inspectorController()->evaluateForTestInFrontend(callId, script); } - -#ifdef HAVE_GSETTINGS -static bool isSchemaAvailable(const char* schemaID) -{ - const char* const* availableSchemas = g_settings_list_schemas(); - char* const* iter = const_cast<char* const*>(availableSchemas); - - while (*iter) { - if (g_str_equal(schemaID, *iter)) - return true; - iter++; - } - - return false; -} - -GSettings* inspectorGSettings() -{ - static GSettings* settings = 0; - if (settings) - return settings; - - // Unfortunately GSettings will abort the process execution if the schema is not - // installed, which is the case for when running tests, or even the introspection dump - // at build time, so check if we have the schema before trying to initialize it. - const gchar* schemaID = "org.webkitgtk-"WEBKITGTK_API_VERSION_STRING".inspector"; - if (!isSchemaAvailable(schemaID)) { - - // This warning is very common on the build bots, which hides valid warnings. - // Skip printing it if we are running inside DumpRenderTree. - if (!DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) - g_warning("GSettings schema not found - settings will not be used or saved."); - return 0; - } - - settings = g_settings_new(schemaID); - return settings; -} -#endif diff --git a/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h b/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h index 46d57b0b8..64ba09a5d 100644 --- a/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h +++ b/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h @@ -25,10 +25,6 @@ extern "C" { -#ifdef HAVE_GSETTINGS -GSettings* inspectorGSettings(); -#endif - void webkit_web_inspector_set_inspector_client(WebKitWebInspector*, WebCore::Page*); void webkit_web_inspector_set_web_view(WebKitWebInspector*, WebKitWebView*); diff --git a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp index d91c3bbf3..bf6ff600d 100644 --- a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -183,7 +183,7 @@ static String chromeUserAgent() DEFINE_STATIC_LOCAL(const String, uaVersion, (makeString(String::number(WEBKIT_USER_AGENT_MAJOR_VERSION), '.', String::number(WEBKIT_USER_AGENT_MINOR_VERSION), '+'))); DEFINE_STATIC_LOCAL(const String, staticUA, (makeString("Mozilla/5.0 (", webkitPlatform(), webkitOSVersion(), ") AppleWebKit/", uaVersion) + - makeString(" (KHTML, like Gecko) Chromium/15.0.874.120 Chrome/15.0.874.120 Safari/", uaVersion))); + makeString(" (KHTML, like Gecko) Chromium/17.0.963.56 Chrome/17.0.963.56 Safari/", uaVersion))); return staticUA; } diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index c22461c74..89b9c228f 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -212,6 +212,8 @@ enum { RESOURCE_LOAD_FINISHED, RESOURCE_CONTENT_LENGTH_RECEIVED, RESOURCE_LOAD_FAILED, + ENTERING_FULLSCREEN, + LEAVING_FULLSCREEN, LAST_SIGNAL }; @@ -639,6 +641,9 @@ static gboolean webkit_web_view_expose_event(GtkWidget* widget, GdkEventExpose* copyRectFromCairoSurfaceToContext(WEBKIT_WEB_VIEW(widget)->priv->backingStore->cairoSurface(), cr.get(), IntSize(), IntRect(rects.get()[i])); } + + // Chaining up to the parent forces child widgets to be drawn. + GTK_WIDGET_CLASS(webkit_web_view_parent_class)->expose_event(widget, event); return FALSE; } #else @@ -667,6 +672,8 @@ static gboolean webkit_web_view_draw(GtkWidget* widget, cairo_t* cr) } cairo_rectangle_list_destroy(rectList); + // Chaining up to the parent forces child widgets to be drawn. + GTK_WIDGET_CLASS(webkit_web_view_parent_class)->draw(widget, cr); return FALSE; } #endif // GTK_API_VERSION_2 @@ -1295,6 +1302,16 @@ static gboolean webkit_web_view_real_should_allow_editing_action(WebKitWebView*) return TRUE; } +static gboolean webkit_web_view_real_entering_fullscreen(WebKitWebView* webView) +{ + return FALSE; +} + +static gboolean webkit_web_view_real_leaving_fullscreen(WebKitWebView* webView) +{ + return FALSE; +} + static void webkit_web_view_dispose(GObject* object) { WebKitWebView* webView = WEBKIT_WEB_VIEW(object); @@ -2650,6 +2667,59 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_NONE, 1, WEBKIT_TYPE_VIEWPORT_ATTRIBUTES); + /** + * WebKitWebView::entering-fullscreen: + * @web_view: the #WebKitWebView on which the signal is emitted. + * @element: the #WebKitDOMHTMLElement which has requested full screen display. + * + * Emitted when JavaScript code calls + * <function>element.webkitRequestFullScreen</function>. If the + * signal is not handled the WebView will proceed to full screen + * its top level window. This signal can be used by client code to + * request permission to the user prior doing the full screen + * transition and eventually prepare the top-level window + * (e.g. hide some widgets that would otherwise be part of the + * full screen window). + * + * Returns: %TRUE to stop other handlers from being invoked for the event. + * %FALSE to continue emission of the event. + * + * Since: 1.9.0 + */ + webkit_web_view_signals[ENTERING_FULLSCREEN] = + g_signal_new("entering-fullscreen", + G_TYPE_FROM_CLASS(webViewClass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(WebKitWebViewClass, entering_fullscreen), + g_signal_accumulator_true_handled, 0, + webkit_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_HTML_ELEMENT); + + + /** + * WebKitWebView::leaving-fullscreen: + * @web_view: the #WebKitWebView on which the signal is emitted. + * @element: the #WebKitDOMHTMLElement which is currently displayed full screen. + * + * Emitted when the WebView is about to restore its top level + * window out of its full screen state. This signal can be used by + * client code to restore widgets hidden during the + * entering-fullscreen stage for instance. + * + * Returns: %TRUE to stop other handlers from being invoked for the event. + * %FALSE to continue emission of the event. + * + * Since: 1.9.0 + */ + webkit_web_view_signals[LEAVING_FULLSCREEN] = + g_signal_new("leaving-fullscreen", + G_TYPE_FROM_CLASS(webViewClass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(WebKitWebViewClass, leaving_fullscreen), + g_signal_accumulator_true_handled, 0, + webkit_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, 1, WEBKIT_TYPE_DOM_HTML_ELEMENT); + /* * WebKitWebView::resource-response-received * @webView: the object which received the signal @@ -2758,6 +2828,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) webViewClass->redo = webkit_web_view_real_redo; webViewClass->move_cursor = webkit_web_view_real_move_cursor; webViewClass->should_allow_editing_action = webkit_web_view_real_should_allow_editing_action; + webViewClass->entering_fullscreen = webkit_web_view_real_entering_fullscreen; + webViewClass->leaving_fullscreen = webkit_web_view_real_leaving_fullscreen; GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass); objectClass->dispose = webkit_web_view_dispose; @@ -3417,11 +3489,6 @@ static void webkit_web_view_init(WebKitWebView* webView) pageClients.dragClient = new WebKit::DragClient(webView); pageClients.inspectorClient = new WebKit::InspectorClient(webView); -#if ENABLE(DEVICE_ORIENTATION) - pageClients.deviceMotionClient = static_cast<WebCore::DeviceMotionClient*>(new DeviceMotionClientGtk); - pageClients.deviceOrientationClient = static_cast<WebCore::DeviceOrientationClient*>(new DeviceOrientationClientGtk); -#endif - #if ENABLE(CLIENT_BASED_GEOLOCATION) if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) pageClients.geolocationClient = new GeolocationClientMock; @@ -3431,6 +3498,11 @@ static void webkit_web_view_init(WebKitWebView* webView) priv->corePage = new Page(pageClients); +#if ENABLE(DEVICE_ORIENTATION) + WebCore::provideDeviceMotionTo(priv->corePage, new DeviceMotionClientGtk); + WebCore::provideDeviceOrientationTo(priv->corePage, new DeviceOrientationClientGtk); +#endif + #if ENABLE(CLIENT_BASED_GEOLOCATION) if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) static_cast<GeolocationClientMock*>(pageClients.geolocationClient)->setController(priv->corePage->geolocationController()); diff --git a/Source/WebKit/gtk/webkit/webkitwebview.h b/Source/WebKit/gtk/webkit/webkitwebview.h index 678e32966..2a15b53c6 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.h +++ b/Source/WebKit/gtk/webkit/webkitwebview.h @@ -176,11 +176,11 @@ struct _WebKitWebViewClass { void (* undo) (WebKitWebView *web_view); void (* redo) (WebKitWebView *web_view); gboolean (* should_allow_editing_action) (WebKitWebView *web_view); + gboolean (* entering_fullscreen) (WebKitWebView *web_view); + gboolean (* leaving_fullscreen) (WebKitWebView *web_view); /* Padding for future expansion */ void (*_webkit_reserved0) (void); - void (*_webkit_reserved1) (void); - void (*_webkit_reserved2) (void); }; WEBKIT_API GType |