Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: webkit/plugins/npapi/gtk_plugin_container_manager.cc

Issue 8588068: GTK: Create the start of a compatibility header wrapping deprecated methods. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to ToT and remove views/ cleanups. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/gtk_preserve_window.cc ('k') | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/plugins/npapi/gtk_plugin_container_manager.h" 5 #include "webkit/plugins/npapi/gtk_plugin_container_manager.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/base/gtk/gtk_compat.h"
10 #include "ui/gfx/gtk_util.h" 11 #include "ui/gfx/gtk_util.h"
11 #include "webkit/plugins/npapi/gtk_plugin_container.h" 12 #include "webkit/plugins/npapi/gtk_plugin_container.h"
12 #include "webkit/plugins/npapi/webplugin.h" 13 #include "webkit/plugins/npapi/webplugin.h"
13 14
14 namespace webkit { 15 namespace webkit {
15 namespace npapi { 16 namespace npapi {
16 17
17 GtkPluginContainerManager::GtkPluginContainerManager() : host_widget_(NULL) {} 18 GtkPluginContainerManager::GtkPluginContainerManager() : host_widget_(NULL) {}
18 19
19 GtkPluginContainerManager::~GtkPluginContainerManager() {} 20 GtkPluginContainerManager::~GtkPluginContainerManager() {}
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 74 }
74 75
75 gtk_widget_show(widget); 76 gtk_widget_show(widget);
76 77
77 if (!move.rects_valid) 78 if (!move.rects_valid)
78 return; 79 return;
79 80
80 // TODO(piman): if the widget hasn't been realized (e.g. the tab has been 81 // TODO(piman): if the widget hasn't been realized (e.g. the tab has been
81 // torn off and the parent gtk widget has been detached from the hierarchy), 82 // torn off and the parent gtk widget has been detached from the hierarchy),
82 // we lose the cutout information. 83 // we lose the cutout information.
83 if (GTK_WIDGET_REALIZED(widget)) { 84 if (gtk_widget_get_realized(widget)) {
84 GdkRectangle clip_rect = move.clip_rect.ToGdkRectangle(); 85 GdkRectangle clip_rect = move.clip_rect.ToGdkRectangle();
85 GdkRegion* clip_region = gdk_region_rectangle(&clip_rect); 86 GdkRegion* clip_region = gdk_region_rectangle(&clip_rect);
86 gfx::SubtractRectanglesFromRegion(clip_region, move.cutout_rects); 87 gfx::SubtractRectanglesFromRegion(clip_region, move.cutout_rects);
87 gdk_window_shape_combine_region(widget->window, clip_region, 0, 0); 88 gdk_window_shape_combine_region(widget->window, clip_region, 0, 0);
88 gdk_region_destroy(clip_region); 89 gdk_region_destroy(clip_region);
89 } 90 }
90 91
91 // Update the window position. Resizing is handled by WebPluginDelegate. 92 // Update the window position. Resizing is handled by WebPluginDelegate.
92 // TODO(deanm): Verify that we only need to move and not resize. 93 // TODO(deanm): Verify that we only need to move and not resize.
93 // TODO(evanm): we should cache the last shape and position and skip all 94 // TODO(evanm): we should cache the last shape and position and skip all
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 GtkPluginContainerManager* plugin_container_manager = 153 GtkPluginContainerManager* plugin_container_manager =
153 static_cast<GtkPluginContainerManager*>(user_data); 154 static_cast<GtkPluginContainerManager*>(user_data);
154 155
155 gfx::PluginWindowHandle id = plugin_container_manager->MapWidgetToID(widget); 156 gfx::PluginWindowHandle id = plugin_container_manager->MapWidgetToID(widget);
156 if (id) 157 if (id)
157 gtk_socket_add_id(GTK_SOCKET(widget), id); 158 gtk_socket_add_id(GTK_SOCKET(widget), id);
158 } 159 }
159 160
160 } // namespace npapi 161 } // namespace npapi
161 } // namespace webkit 162 } // namespace webkit
OLDNEW
« no previous file with comments | « ui/gfx/gtk_preserve_window.cc ('k') | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698