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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // | 144 // |
145 // NOTE: the coordinates of the events are in that of the | 145 // NOTE: the coordinates of the events are in that of the |
146 // MenuScrollViewContainer. | 146 // MenuScrollViewContainer. |
147 bool OnMousePressed(SubmenuView* source, const ui::MouseEvent& event); | 147 bool OnMousePressed(SubmenuView* source, const ui::MouseEvent& event); |
148 bool OnMouseDragged(SubmenuView* source, const ui::MouseEvent& event); | 148 bool OnMouseDragged(SubmenuView* source, const ui::MouseEvent& event); |
149 void OnMouseReleased(SubmenuView* source, const ui::MouseEvent& event); | 149 void OnMouseReleased(SubmenuView* source, const ui::MouseEvent& event); |
150 void OnMouseMoved(SubmenuView* source, const ui::MouseEvent& event); | 150 void OnMouseMoved(SubmenuView* source, const ui::MouseEvent& event); |
151 void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event); | 151 void OnMouseEntered(SubmenuView* source, const ui::MouseEvent& event); |
152 bool OnMouseWheel(SubmenuView* source, const ui::MouseWheelEvent& event); | 152 bool OnMouseWheel(SubmenuView* source, const ui::MouseWheelEvent& event); |
153 void OnGestureEvent(SubmenuView* source, ui::GestureEvent* event); | 153 void OnGestureEvent(SubmenuView* source, ui::GestureEvent* event); |
| 154 void OnTouchEvent(SubmenuView* source, ui::TouchEvent* event); |
154 View* GetTooltipHandlerForPoint(SubmenuView* source, const gfx::Point& point); | 155 View* GetTooltipHandlerForPoint(SubmenuView* source, const gfx::Point& point); |
155 void ViewHierarchyChanged(SubmenuView* source, | 156 void ViewHierarchyChanged(SubmenuView* source, |
156 const View::ViewHierarchyChangedDetails& details); | 157 const View::ViewHierarchyChangedDetails& details); |
157 | 158 |
158 bool GetDropFormats(SubmenuView* source, | 159 bool GetDropFormats(SubmenuView* source, |
159 int* formats, | 160 int* formats, |
160 std::set<ui::Clipboard::FormatType>* format_types); | 161 std::set<ui::Clipboard::FormatType>* format_types); |
161 bool AreDropTypesRequired(SubmenuView* source); | 162 bool AreDropTypesRequired(SubmenuView* source); |
162 bool CanDrop(SubmenuView* source, const ui::OSExchangeData& data); | 163 bool CanDrop(SubmenuView* source, const ui::OSExchangeData& data); |
163 void OnDragEntered(SubmenuView* source, const ui::DropTargetEvent& event); | 164 void OnDragEntered(SubmenuView* source, const ui::DropTargetEvent& event); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // Sets the selection to |menu_item|. A value of NULL unselects | 301 // Sets the selection to |menu_item|. A value of NULL unselects |
301 // everything. |types| is a bitmask of |SetSelectionTypes|. | 302 // everything. |types| is a bitmask of |SetSelectionTypes|. |
302 // | 303 // |
303 // Internally this updates pending_state_ immediatley. state_ is only updated | 304 // Internally this updates pending_state_ immediatley. state_ is only updated |
304 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If | 305 // immediately if SELECTION_UPDATE_IMMEDIATELY is set. If |
305 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked | 306 // SELECTION_UPDATE_IMMEDIATELY is not set CommitPendingSelection is invoked |
306 // to show/hide submenus and update state_. | 307 // to show/hide submenus and update state_. |
307 void SetSelection(MenuItemView* menu_item, int types); | 308 void SetSelection(MenuItemView* menu_item, int types); |
308 | 309 |
309 void SetSelectionOnPointerDown(SubmenuView* source, | 310 void SetSelectionOnPointerDown(SubmenuView* source, |
310 const ui::LocatedEvent& event); | 311 const ui::LocatedEvent* event); |
311 void StartDrag(SubmenuView* source, const gfx::Point& location); | 312 void StartDrag(SubmenuView* source, const gfx::Point& location); |
312 | 313 |
313 // Key processing. | 314 // Key processing. |
314 void OnKeyDown(ui::KeyboardCode key_code); | 315 void OnKeyDown(ui::KeyboardCode key_code); |
315 | 316 |
316 // Creates a MenuController. If |blocking| is true a nested message loop is | 317 // Creates a MenuController. If |blocking| is true a nested message loop is |
317 // started in |Run|. | 318 // started in |Run|. |
318 MenuController(bool blocking, | 319 MenuController(bool blocking, |
319 internal::MenuControllerDelegate* delegate); | 320 internal::MenuControllerDelegate* delegate); |
320 | 321 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // Selects by mnemonic, and if that doesn't work tries the first character of | 496 // Selects by mnemonic, and if that doesn't work tries the first character of |
496 // the title. | 497 // the title. |
497 void SelectByChar(base::char16 key); | 498 void SelectByChar(base::char16 key); |
498 | 499 |
499 // For Windows and Aura we repost an event for some events that dismiss | 500 // For Windows and Aura we repost an event for some events that dismiss |
500 // the context menu. The event is then reprocessed to cause its result | 501 // the context menu. The event is then reprocessed to cause its result |
501 // if the context menu had not been present. | 502 // if the context menu had not been present. |
502 // On non-aura Windows, a new mouse event is generated and posted to | 503 // On non-aura Windows, a new mouse event is generated and posted to |
503 // the window (if there is one) at the location of the event. On | 504 // the window (if there is one) at the location of the event. On |
504 // aura, the event is reposted on the RootWindow. | 505 // aura, the event is reposted on the RootWindow. |
505 void RepostEvent(SubmenuView* source, const ui::LocatedEvent& event); | 506 void RepostEvent(SubmenuView* source, const ui::LocatedEvent* event); |
506 | 507 |
507 // Sets the drop target to new_item. | 508 // Sets the drop target to new_item. |
508 void SetDropMenuItem(MenuItemView* new_item, | 509 void SetDropMenuItem(MenuItemView* new_item, |
509 MenuDelegate::DropPosition position); | 510 MenuDelegate::DropPosition position); |
510 | 511 |
511 // Starts/stops scrolling as appropriate. part gives the part the mouse is | 512 // Starts/stops scrolling as appropriate. part gives the part the mouse is |
512 // over. | 513 // over. |
513 void UpdateScrolling(const MenuPart& part); | 514 void UpdateScrolling(const MenuPart& part); |
514 | 515 |
515 // Stops scrolling. | 516 // Stops scrolling. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 int current_mouse_pressed_state_; | 690 int current_mouse_pressed_state_; |
690 | 691 |
691 scoped_ptr<MenuMessageLoop> message_loop_; | 692 scoped_ptr<MenuMessageLoop> message_loop_; |
692 | 693 |
693 DISALLOW_COPY_AND_ASSIGN(MenuController); | 694 DISALLOW_COPY_AND_ASSIGN(MenuController); |
694 }; | 695 }; |
695 | 696 |
696 } // namespace views | 697 } // namespace views |
697 | 698 |
698 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 699 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |