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

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

Issue 395563002: Make RootView::DispatchGestureEvent() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nit Created 6 years, 5 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
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/view_targeter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/menu_item_view.h" 8 #include "ui/views/controls/menu/menu_item_view.h"
9 #include "ui/views/controls/menu/submenu_view.h" 9 #include "ui/views/controls/menu/submenu_view.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 RootView::OnMouseMoved(event); 48 RootView::OnMouseMoved(event);
49 if (GetMenuController()) 49 if (GetMenuController())
50 GetMenuController()->OnMouseMoved(submenu_, event); 50 GetMenuController()->OnMouseMoved(submenu_, event);
51 } 51 }
52 52
53 bool MenuHostRootView::OnMouseWheel(const ui::MouseWheelEvent& event) { 53 bool MenuHostRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
54 return GetMenuController() && 54 return GetMenuController() &&
55 GetMenuController()->OnMouseWheel(submenu_, event); 55 GetMenuController()->OnMouseWheel(submenu_, event);
56 } 56 }
57 57
58 void MenuHostRootView::DispatchGestureEvent(ui::GestureEvent* event) { 58 ui::EventDispatchDetails MenuHostRootView::OnEventFromSource(ui::Event* event) {
59 RootView::DispatchGestureEvent(event); 59 ui::EventDispatchDetails result = RootView::OnEventFromSource(event);
60 if (event->handled()) 60
61 return; 61 if (event->IsGestureEvent()) {
62 // ChromeOS uses MenuController to forward events like other 62 ui::GestureEvent* gesture_event = event->AsGestureEvent();
63 // mouse events. 63 if (gesture_event->handled())
64 if (!GetMenuController()) 64 return result;
65 return; 65 // ChromeOS uses MenuController to forward events like other
66 GetMenuController()->OnGestureEvent(submenu_, event); 66 // mouse events.
67 if (!GetMenuController())
68 return result;
69 GetMenuController()->OnGestureEvent(submenu_, gesture_event);
70 }
71
72 return result;
67 } 73 }
68 74
69 MenuController* MenuHostRootView::GetMenuController() { 75 MenuController* MenuHostRootView::GetMenuController() {
70 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; 76 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL;
71 } 77 }
72 78
73 bool MenuHostRootView::DoesEventTargetEmptyMenuItem( 79 bool MenuHostRootView::DoesEventTargetEmptyMenuItem(
74 const ui::MouseEvent& event) { 80 const ui::MouseEvent& event) {
75 View* view = GetEventHandlerForPoint(event.location()); 81 View* view = GetEventHandlerForPoint(event.location());
76 return view && view->id() == MenuItemView::kEmptyMenuItemViewID; 82 return view && view->id() == MenuItemView::kEmptyMenuItemViewID;
77 } 83 }
78 84
79 } // namespace views 85 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/view_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698