| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void OnDragWillStart(); | 157 void OnDragWillStart(); |
| 158 | 158 |
| 159 // Called by the Widget when the drag has completed. |should_close| | 159 // Called by the Widget when the drag has completed. |should_close| |
| 160 // corresponds to whether or not the menu should close. | 160 // corresponds to whether or not the menu should close. |
| 161 void OnDragComplete(bool should_close); | 161 void OnDragComplete(bool should_close); |
| 162 | 162 |
| 163 // Update the submenu's selection based on the current mouse location | 163 // Update the submenu's selection based on the current mouse location |
| 164 void UpdateSubmenuSelection(SubmenuView* source); | 164 void UpdateSubmenuSelection(SubmenuView* source); |
| 165 | 165 |
| 166 // WidgetObserver overrides: | 166 // WidgetObserver overrides: |
| 167 virtual void OnWidgetDestroying(Widget* widget) override; | 167 void OnWidgetDestroying(Widget* widget) override; |
| 168 | 168 |
| 169 // Only used for testing. | 169 // Only used for testing. |
| 170 bool IsCancelAllTimerRunningForTest(); | 170 bool IsCancelAllTimerRunningForTest(); |
| 171 | 171 |
| 172 // Only used for testing. | 172 // Only used for testing. |
| 173 static void TurnOffMenuSelectionHoldForTest(); | 173 static void TurnOffMenuSelectionHoldForTest(); |
| 174 | 174 |
| 175 private: | 175 private: |
| 176 friend class internal::MenuEventDispatcher; | 176 friend class internal::MenuEventDispatcher; |
| 177 friend class internal::MenuMessagePumpDispatcher; | 177 friend class internal::MenuMessagePumpDispatcher; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // In other words, if this returns false (which happens if escape was | 291 // In other words, if this returns false (which happens if escape was |
| 292 // pressed, or a matching mnemonic was found) the message loop returns. | 292 // pressed, or a matching mnemonic was found) the message loop returns. |
| 293 bool OnKeyDown(ui::KeyboardCode key_code); | 293 bool OnKeyDown(ui::KeyboardCode key_code); |
| 294 | 294 |
| 295 // Creates a MenuController. If |blocking| is true a nested message loop is | 295 // Creates a MenuController. If |blocking| is true a nested message loop is |
| 296 // started in |Run|. | 296 // started in |Run|. |
| 297 MenuController(ui::NativeTheme* theme, | 297 MenuController(ui::NativeTheme* theme, |
| 298 bool blocking, | 298 bool blocking, |
| 299 internal::MenuControllerDelegate* delegate); | 299 internal::MenuControllerDelegate* delegate); |
| 300 | 300 |
| 301 virtual ~MenuController(); | 301 ~MenuController() override; |
| 302 | 302 |
| 303 // Runs the platform specific bits of the message loop. If |nested_menu| is | 303 // Runs the platform specific bits of the message loop. If |nested_menu| is |
| 304 // true we're being asked to run a menu from within a menu (eg a context | 304 // true we're being asked to run a menu from within a menu (eg a context |
| 305 // menu). | 305 // menu). |
| 306 void RunMessageLoop(bool nested_menu); | 306 void RunMessageLoop(bool nested_menu); |
| 307 | 307 |
| 308 // AcceleratorPressed is invoked on the hot tracked view if it exists. | 308 // AcceleratorPressed is invoked on the hot tracked view if it exists. |
| 309 SendAcceleratorResultType SendAcceleratorToHotTrackedView(); | 309 SendAcceleratorResultType SendAcceleratorToHotTrackedView(); |
| 310 | 310 |
| 311 void UpdateInitialLocation(const gfx::Rect& bounds, | 311 void UpdateInitialLocation(const gfx::Rect& bounds, |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 bool item_selected_by_touch_; | 632 bool item_selected_by_touch_; |
| 633 | 633 |
| 634 scoped_ptr<MenuMessageLoop> message_loop_; | 634 scoped_ptr<MenuMessageLoop> message_loop_; |
| 635 | 635 |
| 636 DISALLOW_COPY_AND_ASSIGN(MenuController); | 636 DISALLOW_COPY_AND_ASSIGN(MenuController); |
| 637 }; | 637 }; |
| 638 | 638 |
| 639 } // namespace views | 639 } // namespace views |
| 640 | 640 |
| 641 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 641 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
| OLD | NEW |