diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 01:17:31 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 01:17:31 +0000 |
commit | a7e1b45acd4e99f391420981d1324afeda100889 (patch) | |
tree | cbdb56d0885473a24c71f10ae60469219b7f7b37 /webkit | |
parent | f5b26caccf0dae6145b0b81580c59a813fb7b835 (diff) | |
download | chromium_src-a7e1b45acd4e99f391420981d1324afeda100889.zip chromium_src-a7e1b45acd4e99f391420981d1324afeda100889.tar.gz chromium_src-a7e1b45acd4e99f391420981d1324afeda100889.tar.bz2 |
GTK: Create the start of a compatibility header wrapping deprecated methods.
GTK 2.24 deprecated all sorts of raw access to object internals in preparation
for GTK3.
BUG=79722
TEST=compiles
TBR=tony,jam
Review URL: http://codereview.chromium.org/8588068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/npapi/gtk_plugin_container_manager.cc | 5 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc | 6 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/webkit/plugins/npapi/gtk_plugin_container_manager.cc b/webkit/plugins/npapi/gtk_plugin_container_manager.cc index 1c84bfb..79897e2 100644 --- a/webkit/plugins/npapi/gtk_plugin_container_manager.cc +++ b/webkit/plugins/npapi/gtk_plugin_container_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,7 @@ #include <gtk/gtk.h> #include "base/logging.h" +#include "ui/base/gtk/gtk_compat.h" #include "ui/gfx/gtk_util.h" #include "webkit/plugins/npapi/gtk_plugin_container.h" #include "webkit/plugins/npapi/webplugin.h" @@ -80,7 +81,7 @@ void GtkPluginContainerManager::MovePluginContainer( // TODO(piman): if the widget hasn't been realized (e.g. the tab has been // torn off and the parent gtk widget has been detached from the hierarchy), // we lose the cutout information. - if (GTK_WIDGET_REALIZED(widget)) { + if (gtk_widget_get_realized(widget)) { GdkRectangle clip_rect = move.clip_rect.ToGdkRectangle(); GdkRegion* clip_region = gdk_region_rectangle(&clip_rect); gfx::SubtractRectanglesFromRegion(clip_region, move.cutout_rects); diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc index ebd7619..e7d6ff5 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc @@ -19,6 +19,7 @@ #include "skia/ext/platform_canvas.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" +#include "ui/base/gtk/gtk_compat.h" #include "ui/gfx/blit.h" #include "webkit/plugins/npapi/gtk_plugin_container.h" #include "webkit/plugins/npapi/plugin_constants_win.h" @@ -242,7 +243,7 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry( void WebPluginDelegateImpl::EnsurePixmapAtLeastSize(int width, int height) { if (pixmap_) { gint cur_width, cur_height; - gdk_drawable_get_size(pixmap_, &cur_width, &cur_height); + gdk_pixmap_get_size(pixmap_, &cur_width, &cur_height); if (cur_width >= width && cur_height >= height) return; // We are already the appropriate size. @@ -256,9 +257,10 @@ void WebPluginDelegateImpl::EnsurePixmapAtLeastSize(int width, int height) { pixmap_ = gdk_pixmap_new(NULL, // use width/height/depth params std::max(1, width), std::max(1, height), sys_visual->depth); + // TODO(erg): Replace this with GdkVisual when we move to GTK3. GdkColormap* colormap = gdk_colormap_new(gdk_visual_get_system(), FALSE); - gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap_), colormap); + gdk_drawable_set_colormap(pixmap_, colormap); // The GdkDrawable now owns the GdkColormap. g_object_unref(colormap); } diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index e4a638b..c2b37b1 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -25,6 +25,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPoint.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" +#include "ui/base/gtk/gtk_compat.h" #include "ui/base/resource/resource_bundle.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webkit_glue.h" @@ -431,7 +432,7 @@ void TestShell::InteractiveSetFocus(WebWidgetHost* host, bool enable) { gtk_widget_grab_focus(widget); } else if (gtk_widget_is_focus(widget)) { GtkWidget *toplevel = gtk_widget_get_toplevel(widget); - if (GTK_WIDGET_TOPLEVEL(toplevel)) + if (gtk_widget_is_toplevel(toplevel)) gtk_window_set_focus(GTK_WINDOW(toplevel), NULL); } } |