OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/gfx/gtk_native_view_id_manager.h" | 5 #include "ui/gfx/gtk_native_view_id_manager.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (i == perm_xid_to_info_.end()) | 167 if (i == perm_xid_to_info_.end()) |
168 return; | 168 return; |
169 | 169 |
170 if (i->second.ref_count > 1) { | 170 if (i->second.ref_count > 1) { |
171 i->second.ref_count--; | 171 i->second.ref_count--; |
172 } else { | 172 } else { |
173 if (i->second.widget) { | 173 if (i->second.widget) { |
174 gtk_preserve_window_set_preserve(i->second.widget, FALSE); | 174 gtk_preserve_window_set_preserve(i->second.widget, FALSE); |
175 } else { | 175 } else { |
176 GdkWindow* window = reinterpret_cast<GdkWindow*>( | 176 GdkWindow* window = reinterpret_cast<GdkWindow*>( |
177 gdk_xid_table_lookup(xid)); | 177 gdk_x11_window_lookup_for_display(gdk_display_get_default(), xid)); |
178 DCHECK(window); | 178 DCHECK(window); |
179 gdk_window_destroy(window); | 179 gdk_window_destroy(window); |
180 } | 180 } |
181 perm_xid_to_info_.erase(i); | 181 perm_xid_to_info_.erase(i); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 // ----------------------------------------------------------------------------- | 185 // ----------------------------------------------------------------------------- |
186 | 186 |
187 | 187 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 | 242 |
243 if (k != perm_xid_to_info_.end()) | 243 if (k != perm_xid_to_info_.end()) |
244 k->second.widget = NULL; | 244 k->second.widget = NULL; |
245 } | 245 } |
246 | 246 |
247 native_view_to_id_.erase(i); | 247 native_view_to_id_.erase(i); |
248 id_to_info_.erase(j); | 248 id_to_info_.erase(j); |
249 } | 249 } |
250 | 250 |
251 // ----------------------------------------------------------------------------- | 251 // ----------------------------------------------------------------------------- |
OLD | NEW |