Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: ui/views/controls/menu/menu_host.h

Issue 683563002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ 6 #define UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
11 11
12 namespace views { 12 namespace views {
13 13
14 class NativeWidget; 14 class NativeWidget;
15 class SubmenuView; 15 class SubmenuView;
16 class View; 16 class View;
17 class Widget; 17 class Widget;
18 18
19 // SubmenuView uses a MenuHost to house the SubmenuView. 19 // SubmenuView uses a MenuHost to house the SubmenuView.
20 // 20 //
21 // SubmenuView owns the MenuHost. When SubmenuView is done with the MenuHost 21 // SubmenuView owns the MenuHost. When SubmenuView is done with the MenuHost
22 // |DestroyMenuHost| is invoked. The one exception to this is if the native 22 // |DestroyMenuHost| is invoked. The one exception to this is if the native
23 // OS destroys the widget out from under us, in which case |MenuHostDestroyed| 23 // OS destroys the widget out from under us, in which case |MenuHostDestroyed|
24 // is invoked back on the SubmenuView and the SubmenuView then drops references 24 // is invoked back on the SubmenuView and the SubmenuView then drops references
25 // to the MenuHost. 25 // to the MenuHost.
26 class MenuHost : public Widget { 26 class MenuHost : public Widget {
27 public: 27 public:
28 explicit MenuHost(SubmenuView* submenu); 28 explicit MenuHost(SubmenuView* submenu);
29 virtual ~MenuHost(); 29 ~MenuHost() override;
30 30
31 // Initializes and shows the MenuHost. 31 // Initializes and shows the MenuHost.
32 // WARNING: |parent| may be NULL. 32 // WARNING: |parent| may be NULL.
33 void InitMenuHost(Widget* parent, 33 void InitMenuHost(Widget* parent,
34 const gfx::Rect& bounds, 34 const gfx::Rect& bounds,
35 View* contents_view, 35 View* contents_view,
36 bool do_capture); 36 bool do_capture);
37 37
38 // Returns true if the menu host is visible. 38 // Returns true if the menu host is visible.
39 bool IsMenuHostVisible(); 39 bool IsMenuHostVisible();
40 40
41 // Shows the menu host. If |do_capture| is true the menu host should do a 41 // Shows the menu host. If |do_capture| is true the menu host should do a
42 // mouse grab. 42 // mouse grab.
43 void ShowMenuHost(bool do_capture); 43 void ShowMenuHost(bool do_capture);
44 44
45 // Hides the menu host. 45 // Hides the menu host.
46 void HideMenuHost(); 46 void HideMenuHost();
47 47
48 // Destroys and deletes the menu host. 48 // Destroys and deletes the menu host.
49 void DestroyMenuHost(); 49 void DestroyMenuHost();
50 50
51 // Sets the bounds of the menu host. 51 // Sets the bounds of the menu host.
52 void SetMenuHostBounds(const gfx::Rect& bounds); 52 void SetMenuHostBounds(const gfx::Rect& bounds);
53 53
54 // Releases a mouse grab installed by |ShowMenuHost|. 54 // Releases a mouse grab installed by |ShowMenuHost|.
55 void ReleaseMenuHostCapture(); 55 void ReleaseMenuHostCapture();
56 56
57 private: 57 private:
58 // Overridden from Widget: 58 // Overridden from Widget:
59 virtual internal::RootView* CreateRootView() override; 59 internal::RootView* CreateRootView() override;
60 virtual void OnMouseCaptureLost() override; 60 void OnMouseCaptureLost() override;
61 virtual void OnNativeWidgetDestroyed() override; 61 void OnNativeWidgetDestroyed() override;
62 virtual void OnOwnerClosing() override; 62 void OnOwnerClosing() override;
63 virtual void OnDragWillStart() override; 63 void OnDragWillStart() override;
64 virtual void OnDragComplete() override; 64 void OnDragComplete() override;
65 65
66 // The view we contain. 66 // The view we contain.
67 SubmenuView* submenu_; 67 SubmenuView* submenu_;
68 68
69 // If true, DestroyMenuHost has been invoked. 69 // If true, DestroyMenuHost has been invoked.
70 bool destroying_; 70 bool destroying_;
71 71
72 // If true and capture is lost we don't notify the delegate. 72 // If true and capture is lost we don't notify the delegate.
73 bool ignore_capture_lost_; 73 bool ignore_capture_lost_;
74 74
75 DISALLOW_COPY_AND_ASSIGN(MenuHost); 75 DISALLOW_COPY_AND_ASSIGN(MenuHost);
76 }; 76 };
77 77
78 } // namespace views 78 } // namespace views
79 79
80 #endif // UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_ 80 #endif // UI_VIEWS_CONTROLS_MENU_MENU_HOST_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_event_dispatcher_linux.h ('k') | ui/views/controls/menu/menu_host_root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698