OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef BASE_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ | 5 #ifndef APP_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ |
6 #define BASE_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ | 6 #define APP_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
| 10 #include "app/gfx/native_widget_types.h" |
10 #include "base/singleton.h" | 11 #include "base/singleton.h" |
11 #include "base/gfx/native_widget_types.h" | |
12 | 12 |
13 typedef unsigned long XID; | 13 typedef unsigned long XID; |
14 | 14 |
15 // NativeViewIds are the opaque values which the renderer holds as a reference | 15 // NativeViewIds are the opaque values which the renderer holds as a reference |
16 // to a window. These ids are often used in sync calls from the renderer and | 16 // to a window. These ids are often used in sync calls from the renderer and |
17 // one cannot terminate sync calls on the UI thread as that can lead to | 17 // one cannot terminate sync calls on the UI thread as that can lead to |
18 // deadlocks. | 18 // deadlocks. |
19 // | 19 // |
20 // Because of this, we have the BACKGROUND_X11 thread for these calls and this | 20 // Because of this, we have the BACKGROUND_X11 thread for these calls and this |
21 // thread has a separate X connection in order to answer them. But one cannot | 21 // thread has a separate X connection in order to answer them. But one cannot |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // protects native_view_to_id_ and id_to_info_ | 81 // protects native_view_to_id_ and id_to_info_ |
82 Lock lock_; | 82 Lock lock_; |
83 // If asked for an id for the same widget twice, we want to return the same | 83 // If asked for an id for the same widget twice, we want to return the same |
84 // id. So this records the current mapping. | 84 // id. So this records the current mapping. |
85 std::map<gfx::NativeView, gfx::NativeViewId> native_view_to_id_; | 85 std::map<gfx::NativeView, gfx::NativeViewId> native_view_to_id_; |
86 std::map<gfx::NativeViewId, NativeViewInfo> id_to_info_; | 86 std::map<gfx::NativeViewId, NativeViewInfo> id_to_info_; |
87 | 87 |
88 DISALLOW_COPY_AND_ASSIGN(GtkNativeViewManager); | 88 DISALLOW_COPY_AND_ASSIGN(GtkNativeViewManager); |
89 }; | 89 }; |
90 | 90 |
91 #endif // BASE_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ | 91 #endif // APP_GFX_GTK_NATIVE_VIEW_ID_MANAGER_H_ |
OLD | NEW |