| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // WidgetObserver overrides: | 147 // WidgetObserver overrides: |
| 148 virtual void OnWidgetDestroying(Widget* widget) OVERRIDE; | 148 virtual void OnWidgetDestroying(Widget* widget) OVERRIDE; |
| 149 | 149 |
| 150 // Only used for testing. | 150 // Only used for testing. |
| 151 static void TurnOffMenuSelectionHoldForTest(); | 151 static void TurnOffMenuSelectionHoldForTest(); |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 friend class internal::MenuEventDispatcher; | 154 friend class internal::MenuEventDispatcher; |
| 155 friend class internal::MenuMessagePumpDispatcher; | 155 friend class internal::MenuMessagePumpDispatcher; |
| 156 friend class internal::MenuRunnerImpl; | 156 friend class internal::MenuRunnerImpl; |
| 157 friend class MenuControllerTest; |
| 157 friend class MenuHostRootView; | 158 friend class MenuHostRootView; |
| 158 friend class MenuItemView; | 159 friend class MenuItemView; |
| 159 friend class SubmenuView; | 160 friend class SubmenuView; |
| 160 | 161 |
| 161 class MenuScrollTask; | 162 class MenuScrollTask; |
| 162 | 163 |
| 163 struct SelectByCharDetails; | 164 struct SelectByCharDetails; |
| 164 | 165 |
| 165 // Values supplied to SetSelection. | 166 // Values supplied to SetSelection. |
| 166 enum SetSelectionTypes { | 167 enum SetSelectionTypes { |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 const ui::MouseEvent& event); | 469 const ui::MouseEvent& event); |
| 469 | 470 |
| 470 // Sends a mouse capture lost event to the current active mouse view and sets | 471 // Sends a mouse capture lost event to the current active mouse view and sets |
| 471 // it to null. | 472 // it to null. |
| 472 void SendMouseCaptureLostToActiveView(); | 473 void SendMouseCaptureLostToActiveView(); |
| 473 | 474 |
| 474 // Sets/gets the active mouse view. See UpdateActiveMouseView() for details. | 475 // Sets/gets the active mouse view. See UpdateActiveMouseView() for details. |
| 475 void SetActiveMouseView(View* view); | 476 void SetActiveMouseView(View* view); |
| 476 View* GetActiveMouseView(); | 477 View* GetActiveMouseView(); |
| 477 | 478 |
| 478 // Sets exit type. | 479 // Sets exit type. Calling this can terminate the active nested message-loop. |
| 479 void SetExitType(ExitType type); | 480 void SetExitType(ExitType type); |
| 480 | 481 |
| 482 // Terminates the current nested message-loop. |
| 483 void TerminateNestedMessageLoop(); |
| 484 |
| 481 // Returns true if SetExitType() should quit the message loop. | 485 // Returns true if SetExitType() should quit the message loop. |
| 482 bool ShouldQuitNow() const; | 486 bool ShouldQuitNow() const; |
| 483 | 487 |
| 484 // Handles the mouse location event on the submenu |source|. | 488 // Handles the mouse location event on the submenu |source|. |
| 485 void HandleMouseLocation(SubmenuView* source, | 489 void HandleMouseLocation(SubmenuView* source, |
| 486 const gfx::Point& mouse_location); | 490 const gfx::Point& mouse_location); |
| 487 | 491 |
| 488 // Retrieve an appropriate Screen. | 492 // Retrieve an appropriate Screen. |
| 489 gfx::Screen* GetScreen(); | 493 gfx::Screen* GetScreen(); |
| 490 | 494 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 bool item_selected_by_touch_; | 603 bool item_selected_by_touch_; |
| 600 | 604 |
| 601 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; | 605 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; |
| 602 | 606 |
| 603 DISALLOW_COPY_AND_ASSIGN(MenuController); | 607 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 604 }; | 608 }; |
| 605 | 609 |
| 606 } // namespace views | 610 } // namespace views |
| 607 | 611 |
| 608 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 612 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |