summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gtk_native_view_id_manager.cc5
-rw-r--r--gfx/gtk_native_view_id_manager.h6
-rw-r--r--gfx/native_widget_types_gtk.cc2
3 files changed, 9 insertions, 4 deletions
diff --git a/gfx/gtk_native_view_id_manager.cc b/gfx/gtk_native_view_id_manager.cc
index 8d9334d..904f46b 100644
--- a/gfx/gtk_native_view_id_manager.cc
+++ b/gfx/gtk_native_view_id_manager.cc
@@ -41,6 +41,11 @@ GtkNativeViewManager::GtkNativeViewManager() {
GtkNativeViewManager::~GtkNativeViewManager() {
}
+// static
+GtkNativeViewManager* GtkNativeViewManager::GetInstance() {
+ return Singleton<GtkNativeViewManager>::get();
+}
+
gfx::NativeViewId GtkNativeViewManager::GetIdForWidget(gfx::NativeView widget) {
// This is just for unit tests:
if (!widget)
diff --git a/gfx/gtk_native_view_id_manager.h b/gfx/gtk_native_view_id_manager.h
index 05cf0d7..e97a852 100644
--- a/gfx/gtk_native_view_id_manager.h
+++ b/gfx/gtk_native_view_id_manager.h
@@ -36,11 +36,11 @@ struct _GtkPreserveWindow;
// pointers and observes the various signals from the widget for when an X
// window is created, destroyed etc. Thus it provides a thread safe mapping
// from NativeViewIds to the current XID for that widget.
-//
-// You get a reference to the global instance with:
-// Singleton<GtkNativeViewManager>()
class GtkNativeViewManager {
public:
+ // Returns the singleton instance.
+ static GtkNativeViewManager* GetInstance();
+
// Must be called from the UI thread:
//
// Return a NativeViewId for the given widget and attach to the various
diff --git a/gfx/native_widget_types_gtk.cc b/gfx/native_widget_types_gtk.cc
index 097af2b..ccf428c 100644
--- a/gfx/native_widget_types_gtk.cc
+++ b/gfx/native_widget_types_gtk.cc
@@ -9,7 +9,7 @@
namespace gfx {
NativeViewId IdFromNativeView(NativeView view) {
- return Singleton<GtkNativeViewManager>()->GetIdForWidget(view);
+ return GtkNativeViewManager::GetInstance()->GetIdForWidget(view);
}
} // namespace gfx