| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DELEGATE_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_ |
| 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_ |
| 7 | 7 |
| 8 namespace views { | 8 namespace views { |
| 9 | 9 |
| 10 class MenuItemView; | 10 class MenuItemView; |
| 11 | 11 |
| 12 // This is internal as there should be no need for usage of this class outside | 12 // This is internal as there should be no need for usage of this class outside |
| 13 // of views. | 13 // of views. |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 // Used by MenuController to notify of interesting events that are intended for | 16 // Used by MenuController to notify of interesting events that are intended for |
| 17 // the class using MenuController. This is implemented by MenuRunnerImpl. | 17 // the class using MenuController. This is implemented by MenuRunnerImpl. |
| 18 class MenuControllerDelegate { | 18 class MenuControllerDelegate { |
| 19 public: | 19 public: |
| 20 enum NotifyType { | 20 enum NotifyType { |
| 21 NOTIFY_DELEGATE, | 21 NOTIFY_DELEGATE, |
| 22 DONT_NOTIFY_DELEGATE | 22 DONT_NOTIFY_DELEGATE |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // Invoked when MenuController closes a menu and the MenuController was | 25 // Invoked when MenuController closes. unless the owner deletes the |
| 26 // configured for asynchronous or drop (MenuRunner::ASYNC, | 26 // MenuController during MenuDelegate::ExecuteCommand. |mouse_event_flags| are |
| 27 // MenuRunner::FOR_DROP). |mouse_event_flags| are the flags set on the | 27 // the flags set on the ui::MouseEvent which selected |menu|, otherwise 0. |
| 28 // ui::MouseEvent which selected |menu|, otherwise 0. | |
| 29 virtual void OnMenuClosed(NotifyType type, | 28 virtual void OnMenuClosed(NotifyType type, |
| 30 MenuItemView* menu, | 29 MenuItemView* menu, |
| 31 int mouse_event_flags) = 0; | 30 int mouse_event_flags) = 0; |
| 32 | 31 |
| 33 // Invoked when the MenuDelegate::GetSiblingMenu() returns non-NULL. | 32 // Invoked when the MenuDelegate::GetSiblingMenu() returns non-NULL. |
| 34 virtual void SiblingMenuCreated(MenuItemView* menu) = 0; | 33 virtual void SiblingMenuCreated(MenuItemView* menu) = 0; |
| 35 | 34 |
| 36 protected: | 35 protected: |
| 37 virtual ~MenuControllerDelegate() {} | 36 virtual ~MenuControllerDelegate() {} |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 } // namespace internal | 39 } // namespace internal |
| 41 | 40 |
| 42 } // namespace view | 41 } // namespace view |
| 43 | 42 |
| 44 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_ | 43 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_DELEGATE_H_ |
| OLD | NEW |