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

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

Issue 11280290: events: Change gesture-event handler in EventHandler to not return any values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/controls/menu/submenu_view.h » ('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/submenu_view.h" 8 #include "ui/views/controls/menu/submenu_view.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::EventResult MenuHostRootView::DispatchGestureEvent( 65 void MenuHostRootView::DispatchGestureEvent(
66 ui::GestureEvent* event) { 66 ui::GestureEvent* event) {
67 ui::EventResult result = RootView::DispatchGestureEvent(event); 67 RootView::DispatchGestureEvent(event);
68 if (result != ui::ER_UNHANDLED) 68 if (event->handled())
69 return result; 69 return;
70 // ChromeOS uses MenuController to forward events like other 70 // ChromeOS uses MenuController to forward events like other
71 // mouse events. 71 // mouse events.
72 if (!GetMenuController()) 72 if (!GetMenuController())
73 return ui::ER_UNHANDLED; 73 return;
74 return GetMenuController()->OnGestureEvent(submenu_, event); 74 GetMenuController()->OnGestureEvent(submenu_, event);
75 } 75 }
76 76
77 MenuController* MenuHostRootView::GetMenuController() { 77 MenuController* MenuHostRootView::GetMenuController() {
78 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; 78 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL;
79 } 79 }
80 80
81 } // namespace views 81 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/controls/menu/submenu_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698