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