| 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 #include "views/controls/native_view_host_gtk.h" | 5 #include "views/controls/native_view_host_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "views/widget/widget_gtk.h" | 10 #include "views/widget/widget_gtk.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 NativeViewHostGtk::NativeViewHostGtk() : destroy_signal_id_(0) { | 14 NativeViewHostGtk::NativeViewHostGtk() |
| 15 : NativeViewHost(), |
| 16 destroy_signal_id_(0) { |
| 15 } | 17 } |
| 16 | 18 |
| 17 NativeViewHostGtk::~NativeViewHostGtk() { | 19 NativeViewHostGtk::~NativeViewHostGtk() { |
| 18 } | 20 } |
| 19 | 21 |
| 20 // static | 22 // static |
| 21 View* NativeViewHostGtk::GetViewForNative(GtkWidget* widget) { | 23 View* NativeViewHostGtk::GetViewForNative(GtkWidget* widget) { |
| 22 gpointer user_data = g_object_get_data(G_OBJECT(widget), "chrome-view"); | 24 gpointer user_data = g_object_get_data(G_OBJECT(widget), "chrome-view"); |
| 23 return static_cast<View*>(user_data); | 25 return static_cast<View*>(user_data); |
| 24 } | 26 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // static | 148 // static |
| 147 void NativeViewHostGtk::CallDestroy(GtkObject* object) { | 149 void NativeViewHostGtk::CallDestroy(GtkObject* object) { |
| 148 View* view = GetViewForNative(GTK_WIDGET(object)); | 150 View* view = GetViewForNative(GTK_WIDGET(object)); |
| 149 if (!view) | 151 if (!view) |
| 150 return; | 152 return; |
| 151 | 153 |
| 152 return static_cast<NativeViewHostGtk*>(view)->OnDestroy(); | 154 return static_cast<NativeViewHostGtk*>(view)->OnDestroy(); |
| 153 } | 155 } |
| 154 | 156 |
| 155 } // namespace views | 157 } // namespace views |
| OLD | NEW |