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 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ | 5 #ifndef VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ |
6 #define VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ | 6 #define VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/widget/root_view.h" | 9 #include "views/widget/root_view.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class MenuHostRootView : public RootView { | 22 class MenuHostRootView : public RootView { |
23 public: | 23 public: |
24 MenuHostRootView(Widget* widget, SubmenuView* submenu); | 24 MenuHostRootView(Widget* widget, SubmenuView* submenu); |
25 | 25 |
26 // When invoked subsequent events are NOT forwarded to the MenuController. | 26 // When invoked subsequent events are NOT forwarded to the MenuController. |
27 void suspend_events() { suspend_events_ = true; } | 27 void suspend_events() { suspend_events_ = true; } |
28 | 28 |
29 // Overridden from View: | 29 // Overridden from View: |
30 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; | 30 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
31 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; | 31 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
32 virtual void OnMouseReleased(const MouseEvent& event, bool canceled) OVERRIDE; | 32 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; |
| 33 virtual void OnMouseCaptureLost() OVERRIDE; |
33 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; | 34 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; |
34 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; | 35 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; |
35 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; | 36 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; |
36 | 37 |
37 private: | 38 private: |
38 // Returns the MenuController for this MenuHostRootView. | 39 // Returns the MenuController for this MenuHostRootView. |
39 MenuController* GetMenuController(); | 40 MenuController* GetMenuController(); |
40 | 41 |
41 // The SubmenuView we contain. | 42 // The SubmenuView we contain. |
42 SubmenuView* submenu_; | 43 SubmenuView* submenu_; |
43 | 44 |
44 // Whether mouse dragged/released should be forwarded to the MenuController. | 45 // Whether mouse dragged/released should be forwarded to the MenuController. |
45 bool forward_drag_to_menu_controller_; | 46 bool forward_drag_to_menu_controller_; |
46 | 47 |
47 // Whether events are suspended. If true, no events are forwarded to the | 48 // Whether events are suspended. If true, no events are forwarded to the |
48 // MenuController. | 49 // MenuController. |
49 bool suspend_events_; | 50 bool suspend_events_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(MenuHostRootView); | 52 DISALLOW_COPY_AND_ASSIGN(MenuHostRootView); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace views | 55 } // namespace views |
55 | 56 |
56 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ | 57 #endif // VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_ |
OLD | NEW |