summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/focus/accelerator_handler_gtk.cc12
-rw-r--r--views/window/window_gtk.cc13
-rw-r--r--views/window/window_gtk.h6
3 files changed, 7 insertions, 24 deletions
diff --git a/views/focus/accelerator_handler_gtk.cc b/views/focus/accelerator_handler_gtk.cc
index e69553f..fb04e89 100644
--- a/views/focus/accelerator_handler_gtk.cc
+++ b/views/focus/accelerator_handler_gtk.cc
@@ -9,7 +9,7 @@
#include "views/accelerator.h"
#include "views/focus/accelerator_handler.h"
#include "views/focus/focus_manager.h"
-#include "views/window/window_gtk.h"
+#include "views/widget/widget_gtk.h"
namespace views {
@@ -55,10 +55,12 @@ bool AcceleratorHandler::Dispatch(GdkEvent* event) {
gtk_main_do_event(event);
return true;
}
- DCHECK(ptr); // The top-level window is expected to always be associated
- // with the top-level gtk widget.
- WindowGtk* widget =
- WindowGtk::GetWindowForNative(reinterpret_cast<GtkWidget*>(ptr));
+ DCHECK(ptr);
+
+ // The top-level window or window widget is expected to always be associated
+ // with the top-level gtk widget.
+ WidgetGtk* widget =
+ WidgetGtk::GetViewForNative(reinterpret_cast<GtkWidget*>(ptr));
if (!widget) {
// During dnd we get events for windows we don't control (such as the
// window being dragged).
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index 16d3148..f5ffab9 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -373,17 +373,6 @@ void WindowGtk::SetInitialFocus() {
}
}
-// static
-WindowGtk* WindowGtk::GetWindowForNative(GtkWidget* widget) {
- gpointer user_data = g_object_get_data(G_OBJECT(widget), "chrome-window");
- return static_cast<WindowGtk*>(user_data);
-}
-
-// static
-void WindowGtk::SetWindowForNative(GtkWidget* widget, WindowGtk* window) {
- g_object_set_data(G_OBJECT(widget), "chrome-window", window);
-}
-
////////////////////////////////////////////////////////////////////////////////
// WindowGtk, protected:
@@ -423,8 +412,6 @@ void WindowGtk::Init(GtkWindow* parent, const gfx::Rect& bounds) {
UpdateWindowTitle();
SetInitialBounds(parent, bounds);
- SetWindowForNative(GTK_WIDGET(GetNativeWindow()), this);
-
// if (!IsAppWindow()) {
// notification_registrar_.Add(
// this,
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index 358116e..5aa8cbe 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -70,12 +70,6 @@ class WindowGtk : public WidgetGtk, public Window {
virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
virtual void SetInitialFocus();
- // Gets the WindowGtk in the userdata section of the widget.
- static WindowGtk* GetWindowForNative(GtkWidget* widget);
-
- // Sets the WindowGtk in the userdata section of the widget.
- static void SetWindowForNative(GtkWidget* widget, WindowGtk* window);
-
protected:
// For the constructor.
friend class Window;