Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/menu/menu_host_root_view.h" | 5 #include "views/controls/menu/menu_host_root_view.h" |
| 6 | 6 |
| 7 #include "views/controls/menu/menu_controller.h" | 7 #include "views/controls/menu/menu_controller.h" |
| 8 #include "views/controls/menu/submenu_view.h" | 8 #include "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 Loading... | |
| 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) { | |
| 66 #if defined(OS_LINUX) | |
| 67 // ChromeOS uses MenuController to forward events like other | |
| 68 // mouse events. | |
| 69 if (!GetMenuController()) | |
| 70 return ui::GESTURE_STATUS_UNKNOWN; | |
| 71 return GetMenuController()->OnGestureEvent(submenu_, event); | |
| 72 #else | |
| 73 // TODO(vollick): gestures in Windows. | |
|
rjkroege
2012/01/19 16:15:08
you need to hook up with cpu about this I think
| |
| 74 return RootView::OnGestureEvent(event); | |
| 75 #endif | |
| 76 } | |
| 77 | |
| 65 MenuController* MenuHostRootView::GetMenuController() { | 78 MenuController* MenuHostRootView::GetMenuController() { |
| 66 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; | 79 return submenu_ ? submenu_->GetMenuItem()->GetMenuController() : NULL; |
| 67 } | 80 } |
| 68 | 81 |
| 69 } // namespace views | 82 } // namespace views |
| OLD | NEW |