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

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

Issue 10824295: Rid the world of the last of views::Event types: TouchEvent, GestureEvent, MouseWheelEvent, ScrollE… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
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 #include "ui/views/controls/menu/menu_host_root_view.h" 5 #include "ui/views/controls/menu/menu_host_root_view.h"
6 6
7 #include "ui/views/controls/menu/menu_controller.h" 7 #include "ui/views/controls/menu/menu_controller.h"
8 #include "ui/views/controls/menu/submenu_view.h" 8 #include "ui/views/controls/menu/submenu_view.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 29 matching lines...) Expand all
40 GetMenuController()->OnMouseReleased(submenu_, event); 40 GetMenuController()->OnMouseReleased(submenu_, event);
41 } 41 }
42 } 42 }
43 43
44 void MenuHostRootView::OnMouseMoved(const ui::MouseEvent& event) { 44 void MenuHostRootView::OnMouseMoved(const ui::MouseEvent& event) {
45 RootView::OnMouseMoved(event); 45 RootView::OnMouseMoved(event);
46 if (GetMenuController()) 46 if (GetMenuController())
47 GetMenuController()->OnMouseMoved(submenu_, event); 47 GetMenuController()->OnMouseMoved(submenu_, event);
48 } 48 }
49 49
50 bool MenuHostRootView::OnMouseWheel(const MouseWheelEvent& event) { 50 bool MenuHostRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
51 #if defined(OS_LINUX) 51 #if defined(OS_LINUX)
52 // ChromeOS uses MenuController to forward events like other 52 // ChromeOS uses MenuController to forward events like other
53 // mouse events. 53 // mouse events.
54 return GetMenuController() && 54 return GetMenuController() &&
55 GetMenuController()->OnMouseWheel(submenu_, event); 55 GetMenuController()->OnMouseWheel(submenu_, event);
56 #else 56 #else
57 // Windows uses focus_util_win::RerouteMouseWheel to forward events to 57 // Windows uses focus_util_win::RerouteMouseWheel to forward events to
58 // the right menu. 58 // the right menu.
59 // RootView::OnMouseWheel forwards to the focused view. We don't have a 59 // RootView::OnMouseWheel forwards to the focused view. We don't have a
60 // focused view, so we need to override this then forward to the menu. 60 // focused view, so we need to override this then forward to the menu.
61 return submenu_->OnMouseWheel(event); 61 return submenu_->OnMouseWheel(event);
62 #endif 62 #endif
63 } 63 }
64 64
65 ui::GestureStatus MenuHostRootView::OnGestureEvent(const GestureEvent& event) { 65 ui::GestureStatus MenuHostRootView::OnGestureEvent(
66 const ui::GestureEvent& event) {
66 RootView::OnGestureEvent(event); 67 RootView::OnGestureEvent(event);
67 // ChromeOS uses MenuController to forward events like other 68 // ChromeOS uses MenuController to forward events like other
68 // mouse events. 69 // mouse events.
69 if (!GetMenuController()) 70 if (!GetMenuController())
70 return ui::GESTURE_STATUS_UNKNOWN; 71 return ui::GESTURE_STATUS_UNKNOWN;
71 return GetMenuController()->OnGestureEvent(submenu_, event); 72 return GetMenuController()->OnGestureEvent(submenu_, event);
72 } 73 }
73 74
74 MenuController* MenuHostRootView::GetMenuController() { 75 MenuController* MenuHostRootView::GetMenuController() {
75 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; 76 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL;
76 } 77 }
77 78
78 } // namespace views 79 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698