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 "views/widget/native_widget_gtk.h" | 5 #include "views/widget/native_widget_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <X11/extensions/shape.h> | 9 #include <X11/extensions/shape.h> |
10 #include <X11/Xatom.h> | 10 #include <X11/Xatom.h> |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 } | 847 } |
848 | 848 |
849 gfx::NativeView NativeWidgetGtk::GetNativeView() const { | 849 gfx::NativeView NativeWidgetGtk::GetNativeView() const { |
850 return widget_; | 850 return widget_; |
851 } | 851 } |
852 | 852 |
853 gfx::NativeWindow NativeWidgetGtk::GetNativeWindow() const { | 853 gfx::NativeWindow NativeWidgetGtk::GetNativeWindow() const { |
854 return child_ ? NULL : GTK_WINDOW(widget_); | 854 return child_ ? NULL : GTK_WINDOW(widget_); |
855 } | 855 } |
856 | 856 |
| 857 Widget* NativeWidgetGtk::GetTopLevelWidget() { |
| 858 NativeWidgetPrivate* native_widget = GetTopLevelNativeWidget(GetNativeView()); |
| 859 return native_widget ? native_widget->GetWidget() : NULL; |
| 860 } |
| 861 |
857 const ui::Compositor* NativeWidgetGtk::GetCompositor() const { | 862 const ui::Compositor* NativeWidgetGtk::GetCompositor() const { |
858 return compositor_.get(); | 863 return compositor_.get(); |
859 } | 864 } |
860 | 865 |
861 ui::Compositor* NativeWidgetGtk::GetCompositor() { | 866 ui::Compositor* NativeWidgetGtk::GetCompositor() { |
862 return compositor_.get(); | 867 return compositor_.get(); |
863 } | 868 } |
864 | 869 |
865 void NativeWidgetGtk::MarkLayerDirty() { | 870 void NativeWidgetGtk::MarkLayerDirty() { |
866 } | 871 } |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 button_pressed = event->type == GDK_BUTTON_PRESS || | 2150 button_pressed = event->type == GDK_BUTTON_PRESS || |
2146 event->type == GDK_2BUTTON_PRESS || | 2151 event->type == GDK_2BUTTON_PRESS || |
2147 event->type == GDK_3BUTTON_PRESS; | 2152 event->type == GDK_3BUTTON_PRESS; |
2148 gdk_event_free(event); | 2153 gdk_event_free(event); |
2149 } | 2154 } |
2150 return button_pressed; | 2155 return button_pressed; |
2151 } | 2156 } |
2152 | 2157 |
2153 } // namespace internal | 2158 } // namespace internal |
2154 } // namespace views | 2159 } // namespace views |
OLD | NEW |