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

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

Issue 552503003: Introduce EventProcessor::OnEventProcessingStarted() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sadrul comments addressed Created 6 years, 2 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_root_view.h ('k') | ui/views/widget/root_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/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 ui::EventDispatchDetails MenuHostRootView::OnEventFromSource(ui::Event* event) { 58 void MenuHostRootView::OnEventProcessingFinished(ui::Event* event) {
59 ui::EventDispatchDetails result = RootView::OnEventFromSource(event); 59 RootView::OnEventProcessingFinished(event);
60 60
61 if (event->IsGestureEvent()) { 61 // Forward unhandled gesture events to our menu controller.
62 ui::GestureEvent* gesture_event = event->AsGestureEvent(); 62 // TODO(tdanderson): Investigate whether this should be moved into a
63 if (gesture_event->handled()) 63 // post-target handler installed on |this| instead
64 return result; 64 // (invoked only if event->target() == this).
65 // ChromeOS uses MenuController to forward events like other 65 if (event->IsGestureEvent() && !event->handled() && GetMenuController())
66 // mouse events. 66 GetMenuController()->OnGestureEvent(submenu_, event->AsGestureEvent());
67 if (!GetMenuController())
68 return result;
69 GetMenuController()->OnGestureEvent(submenu_, gesture_event);
70 }
71
72 return result;
73 } 67 }
74 68
75 MenuController* MenuHostRootView::GetMenuController() { 69 MenuController* MenuHostRootView::GetMenuController() {
76 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; 70 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL;
77 } 71 }
78 72
79 bool MenuHostRootView::DoesEventTargetEmptyMenuItem( 73 bool MenuHostRootView::DoesEventTargetEmptyMenuItem(
80 const ui::MouseEvent& event) { 74 const ui::MouseEvent& event) {
81 View* view = GetEventHandlerForPoint(event.location()); 75 View* view = GetEventHandlerForPoint(event.location());
82 return view && view->id() == MenuItemView::kEmptyMenuItemViewID; 76 return view && view->id() == MenuItemView::kEmptyMenuItemViewID;
83 } 77 }
84 78
85 } // namespace views 79 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_host_root_view.h ('k') | ui/views/widget/root_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698