| 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_BASE_MODELS_SIMPLE_MENU_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ |
| 6 #define UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ | 6 #define UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual bool GetIconForCommandId(int command_id, SkBitmap* icon) const; | 43 virtual bool GetIconForCommandId(int command_id, SkBitmap* icon) const; |
| 44 | 44 |
| 45 // Notifies the delegate that the item with the specified command id was | 45 // Notifies the delegate that the item with the specified command id was |
| 46 // visually highlighted within the menu. | 46 // visually highlighted within the menu. |
| 47 virtual void CommandIdHighlighted(int command_id); | 47 virtual void CommandIdHighlighted(int command_id); |
| 48 | 48 |
| 49 // Performs the action associated with the specified command id. | 49 // Performs the action associated with the specified command id. |
| 50 virtual void ExecuteCommand(int command_id) = 0; | 50 virtual void ExecuteCommand(int command_id) = 0; |
| 51 | 51 |
| 52 // Notifies the delegate that the menu is about to show. | 52 // Notifies the delegate that the menu is about to show. |
| 53 virtual void MenuWillShow(); | 53 virtual void MenuWillShow(SimpleMenuModel* source); |
| 54 | 54 |
| 55 // Notifies the delegate that the menu has closed. | 55 // Notifies the delegate that the menu has closed. |
| 56 virtual void MenuClosed(); | 56 virtual void MenuClosed(SimpleMenuModel* source); |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~Delegate() {} | 59 virtual ~Delegate() {} |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // The Delegate can be NULL, though if it is items can't be checked or | 62 // The Delegate can be NULL, though if it is items can't be checked or |
| 63 // disabled. | 63 // disabled. |
| 64 explicit SimpleMenuModel(Delegate* delegate); | 64 explicit SimpleMenuModel(Delegate* delegate); |
| 65 virtual ~SimpleMenuModel(); | 65 virtual ~SimpleMenuModel(); |
| 66 | 66 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 MenuModelDelegate* menu_model_delegate_; | 158 MenuModelDelegate* menu_model_delegate_; |
| 159 | 159 |
| 160 ScopedRunnableMethodFactory<SimpleMenuModel> method_factory_; | 160 ScopedRunnableMethodFactory<SimpleMenuModel> method_factory_; |
| 161 | 161 |
| 162 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); | 162 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace ui | 165 } // namespace ui |
| 166 | 166 |
| 167 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ | 167 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ |
| OLD | NEW |