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

Unified Diff: ui/gfx/gtk_native_view_id_manager.cc

Issue 9151007: GTK: Seal up GSEALs, focusing on GtkSelectionData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add gtk_widget_style_attach to make minimal version 2.18 Created 8 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gfx/gtk_preserve_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gtk_native_view_id_manager.cc
diff --git a/ui/gfx/gtk_native_view_id_manager.cc b/ui/gfx/gtk_native_view_id_manager.cc
index 6c053b4251216278c842f003b2fc1462fbd9b8c6..43f324c54914fe46a2795e0c2f647f7d1e57c7cc 100644
--- a/ui/gfx/gtk_native_view_id_manager.cc
+++ b/ui/gfx/gtk_native_view_id_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -69,7 +69,7 @@ gfx::NativeViewId GtkNativeViewManager::GetIdForWidget(gfx::NativeView widget) {
NativeViewInfo info;
info.widget = widget;
if (gtk_widget_get_realized(widget)) {
- GdkWindow *gdk_window = widget->window;
+ GdkWindow *gdk_window = gtk_widget_get_window(widget);
DCHECK(gdk_window);
info.x_window_id = GDK_WINDOW_XID(gdk_window);
}
@@ -128,7 +128,7 @@ bool GtkNativeViewManager::GetPermanentXIDForId(XID* output,
reinterpret_cast<GtkPreserveWindow*>(i->second.widget);
gtk_preserve_window_set_preserve(widget, TRUE);
- *output = GDK_WINDOW_XID(i->second.widget->window);
+ *output = GDK_WINDOW_XID(gtk_widget_get_window(i->second.widget));
// Update the reference count on the permanent XID.
PermanentXIDInfo info;
@@ -207,9 +207,10 @@ void GtkNativeViewManager::OnRealize(gfx::NativeView widget) {
id_to_info_.find(id);
CHECK(i != id_to_info_.end());
- CHECK(widget->window);
- i->second.x_window_id = GDK_WINDOW_XID(widget->window);
+ GdkWindow* gdk_window = gtk_widget_get_window(widget);
+ CHECK(gdk_window);
+ i->second.x_window_id = GDK_WINDOW_XID(gdk_window);
}
void GtkNativeViewManager::OnUnrealize(gfx::NativeView widget) {
@@ -239,7 +240,7 @@ void GtkNativeViewManager::OnDestroy(gfx::NativeView widget) {
gtk_preserve_window_get_preserve(
reinterpret_cast<GtkPreserveWindow*>(widget))) {
std::map<XID, PermanentXIDInfo>::iterator k =
- perm_xid_to_info_.find(GDK_WINDOW_XID(widget->window));
+ perm_xid_to_info_.find(GDK_WINDOW_XID(gtk_widget_get_window(widget)));
if (k != perm_xid_to_info_.end())
k->second.widget = NULL;
« no previous file with comments | « ui/base/x/x11_util.cc ('k') | ui/gfx/gtk_preserve_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698