OLD | NEW |
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 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void CancelAll() { Cancel(EXIT_ALL); } | 102 void CancelAll() { Cancel(EXIT_ALL); } |
103 | 103 |
104 // Returns the current exit type. This returns a value other than EXIT_NONE if | 104 // Returns the current exit type. This returns a value other than EXIT_NONE if |
105 // the menu is being canceled. | 105 // the menu is being canceled. |
106 ExitType exit_type() const { return exit_type_; } | 106 ExitType exit_type() const { return exit_type_; } |
107 | 107 |
108 // Various events, forwarded from the submenu. | 108 // Various events, forwarded from the submenu. |
109 // | 109 // |
110 // NOTE: the coordinates of the events are in that of the | 110 // NOTE: the coordinates of the events are in that of the |
111 // MenuScrollViewContainer. | 111 // MenuScrollViewContainer. |
112 void OnMousePressed(SubmenuView* source, const MouseEvent& event); | 112 void OnMousePressed(SubmenuView* source, const ui::MouseEvent& event); |
113 void OnMouseDragged(SubmenuView* source, const MouseEvent& event); | 113 void OnMouseDragged(SubmenuView* source, const ui::MouseEvent& event); |
114 void OnMouseReleased(SubmenuView* source, const MouseEvent& event); | 114 void OnMouseReleased(SubmenuView* source, const ui::MouseEvent& event); |
115 void OnMouseMoved(SubmenuView* source, const MouseEvent& event); | 115 void OnMouseMoved(SubmenuView* source, const ui::MouseEvent& event); |
116 void OnMouseEntered(SubmenuView* source, const MouseEvent& event); | 116 void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event); |
117 #if defined(OS_LINUX) | 117 #if defined(OS_LINUX) |
118 bool OnMouseWheel(SubmenuView* source, const MouseWheelEvent& event); | 118 bool OnMouseWheel(SubmenuView* source, const MouseWheelEvent& event); |
119 #endif | 119 #endif |
120 ui::GestureStatus OnGestureEvent(SubmenuView* source, | 120 ui::GestureStatus OnGestureEvent(SubmenuView* source, |
121 const GestureEvent& event); | 121 const GestureEvent& event); |
122 | 122 |
123 bool GetDropFormats( | 123 bool GetDropFormats( |
124 SubmenuView* source, | 124 SubmenuView* source, |
125 int* formats, | 125 int* formats, |
126 std::set<ui::OSExchangeData::CustomFormat>* custom_formats); | 126 std::set<ui::OSExchangeData::CustomFormat>* custom_formats); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 void UpdateScrolling(const MenuPart& part); | 424 void UpdateScrolling(const MenuPart& part); |
425 | 425 |
426 // Stops scrolling. | 426 // Stops scrolling. |
427 void StopScrolling(); | 427 void StopScrolling(); |
428 | 428 |
429 // Updates |active_mouse_view_| from the location of the event and sends it | 429 // Updates |active_mouse_view_| from the location of the event and sends it |
430 // the appropriate events. This is used to send mouse events to child views so | 430 // the appropriate events. This is used to send mouse events to child views so |
431 // that they react to click-drag-release as if the user clicked on the view | 431 // that they react to click-drag-release as if the user clicked on the view |
432 // itself. | 432 // itself. |
433 void UpdateActiveMouseView(SubmenuView* event_source, | 433 void UpdateActiveMouseView(SubmenuView* event_source, |
434 const MouseEvent& event, | 434 const ui::MouseEvent& event, |
435 View* target_menu); | 435 View* target_menu); |
436 | 436 |
437 // Sends a mouse release event to the current |active_mouse_view_| and sets | 437 // Sends a mouse release event to the current |active_mouse_view_| and sets |
438 // it to null. | 438 // it to null. |
439 void SendMouseReleaseToActiveView(SubmenuView* event_source, | 439 void SendMouseReleaseToActiveView(SubmenuView* event_source, |
440 const MouseEvent& event); | 440 const ui::MouseEvent& event); |
441 | 441 |
442 // Sends a mouse capture lost event to the current |active_mouse_view_| and | 442 // Sends a mouse capture lost event to the current |active_mouse_view_| and |
443 // sets it to null. | 443 // sets it to null. |
444 void SendMouseCaptureLostToActiveView(); | 444 void SendMouseCaptureLostToActiveView(); |
445 | 445 |
446 // Sets exit type. | 446 // Sets exit type. |
447 void SetExitType(ExitType type); | 447 void SetExitType(ExitType type); |
448 | 448 |
449 // Handles the mouse location event on the submenu |source|. | 449 // Handles the mouse location event on the submenu |source|. |
450 void HandleMouseLocation(SubmenuView* source, | 450 void HandleMouseLocation(SubmenuView* source, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // How deep we are in nested message loops. This should be at most 2 (when | 556 // How deep we are in nested message loops. This should be at most 2 (when |
557 // showing a context menu from a menu). | 557 // showing a context menu from a menu). |
558 int message_loop_depth_; | 558 int message_loop_depth_; |
559 | 559 |
560 DISALLOW_COPY_AND_ASSIGN(MenuController); | 560 DISALLOW_COPY_AND_ASSIGN(MenuController); |
561 }; | 561 }; |
562 | 562 |
563 } // namespace views | 563 } // namespace views |
564 | 564 |
565 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 565 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |