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 | 5 |
6 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 6 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
7 #define VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 7 #define VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
8 | 8 |
9 #include "views/widget/widget_gtk.h" | 9 #include "views/widget/widget_gtk.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 | 12 |
13 class SubmenuView; | 13 class SubmenuView; |
14 | 14 |
15 // MenuHost implementation for Gtk. | 15 // MenuHost implementation for Gtk. |
16 class MenuHost : public WidgetGtk { | 16 class MenuHost : public WidgetGtk { |
17 public: | 17 public: |
18 explicit MenuHost(SubmenuView* submenu); | 18 explicit MenuHost(SubmenuView* submenu); |
19 | 19 |
20 void Init(gfx::NativeWindow parent, | 20 void Init(gfx::NativeWindow parent, |
21 const gfx::Rect& bounds, | 21 const gfx::Rect& bounds, |
22 View* contents_view, | 22 View* contents_view, |
23 bool do_capture); | 23 bool do_capture); |
24 | 24 |
25 gfx::NativeWindow GetNativeWindow(); | 25 gfx::NativeWindow GetNativeWindow(); |
26 | 26 |
27 void Show(); | 27 void Show(); |
28 virtual void Hide(); | 28 virtual void Hide(); |
29 virtual void HideWindow(); | 29 virtual void HideWindow(); |
| 30 void DoCapture(); |
30 void ReleaseCapture(); | 31 void ReleaseCapture(); |
31 | 32 |
32 protected: | 33 protected: |
33 virtual RootView* CreateRootView(); | 34 virtual RootView* CreateRootView(); |
34 | 35 |
35 virtual gboolean OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event); | 36 virtual gboolean OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event); |
36 | 37 |
37 // Overriden to return false, we do NOT want to release capture on mouse | 38 // Overriden to return false, we do NOT want to release capture on mouse |
38 // release. | 39 // release. |
39 virtual bool ReleaseCaptureOnMouseReleased(); | 40 virtual bool ReleaseCaptureOnMouseReleased(); |
(...skipping 10 matching lines...) Expand all Loading... |
50 | 51 |
51 // Have we done a pointer grab? | 52 // Have we done a pointer grab? |
52 bool did_pointer_grab_; | 53 bool did_pointer_grab_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(MenuHost); | 55 DISALLOW_COPY_AND_ASSIGN(MenuHost); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace views | 58 } // namespace views |
58 | 59 |
59 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ | 60 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_GTK_H_ |
OLD | NEW |