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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months 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
« no previous file with comments | « ui/views/controls/menu/menu_host.cc ('k') | ui/views/controls/menu/menu_host_root_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_
6 #define UI_VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_
7
8 #include "ui/views/widget/root_view.h"
9
10 namespace views {
11
12 class MenuController;
13 class SubmenuView;
14
15 // MenuHostRootView is the RootView of the window showing the menu.
16 // SubmenuView's scroll view is added as a child of MenuHostRootView.
17 // MenuHostRootView forwards relevant events to the MenuController.
18 //
19 // As all the menu items are owned by the root menu item, care must be taken
20 // such that when MenuHostRootView is deleted it doesn't delete the menu items.
21 class MenuHostRootView : public internal::RootView {
22 public:
23 MenuHostRootView(Widget* widget, SubmenuView* submenu);
24
25 void ClearSubmenu() { submenu_ = NULL; }
26
27 // Overridden from View:
28 virtual bool OnMousePressed(const ui::MouseEvent& event) override;
29 virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
30 virtual void OnMouseReleased(const ui::MouseEvent& event) override;
31 virtual void OnMouseMoved(const ui::MouseEvent& event) override;
32 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
33
34 private:
35 // ui::EventProcessor:
36 virtual void OnEventProcessingFinished(ui::Event* event) override;
37
38 // Returns the MenuController for this MenuHostRootView.
39 MenuController* GetMenuController();
40
41 // Returns true if event targets EmptyMenu.
42 bool DoesEventTargetEmptyMenuItem(const ui::MouseEvent& event);
43
44 // The SubmenuView we contain.
45 SubmenuView* submenu_;
46
47 // Whether mouse dragged/released should be forwarded to the MenuController.
48 bool forward_drag_to_menu_controller_;
49
50 DISALLOW_COPY_AND_ASSIGN(MenuHostRootView);
51 };
52
53 } // namespace views
54
55 #endif // UI_VIEWS_CONTROLS_MENU_MENU_HOST_ROOT_VIEW_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host.cc ('k') | ui/views/controls/menu/menu_host_root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698