| 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_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 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 int group_id); | 114 int group_id); |
| 115 void InsertRadioItemWithStringIdAt( | 115 void InsertRadioItemWithStringIdAt( |
| 116 int index, int command_id, int string_id, int group_id); | 116 int index, int command_id, int string_id, int group_id); |
| 117 void InsertSubMenuAt(int index, | 117 void InsertSubMenuAt(int index, |
| 118 int command_id, | 118 int command_id, |
| 119 const base::string16& label, | 119 const base::string16& label, |
| 120 MenuModel* model); | 120 MenuModel* model); |
| 121 void InsertSubMenuWithStringIdAt( | 121 void InsertSubMenuWithStringIdAt( |
| 122 int index, int command_id, int string_id, MenuModel* model); | 122 int index, int command_id, int string_id, MenuModel* model); |
| 123 | 123 |
| 124 // Remove item at specified index from the model. |
| 125 void RemoveItemAt(int index); |
| 126 |
| 124 // Sets the icon for the item at |index|. | 127 // Sets the icon for the item at |index|. |
| 125 void SetIcon(int index, const gfx::Image& icon); | 128 void SetIcon(int index, const gfx::Image& icon); |
| 126 | 129 |
| 127 // Sets the sublabel for the item at |index|. | 130 // Sets the sublabel for the item at |index|. |
| 128 void SetSublabel(int index, const base::string16& sublabel); | 131 void SetSublabel(int index, const base::string16& sublabel); |
| 129 | 132 |
| 130 // Sets the minor text for the item at |index|. | 133 // Sets the minor text for the item at |index|. |
| 131 void SetMinorText(int index, const base::string16& minor_text); | 134 void SetMinorText(int index, const base::string16& minor_text); |
| 132 | 135 |
| 133 // Clears all items. Note that it does not free MenuModel of submenu. | 136 // Clears all items. Note that it does not free MenuModel of submenu. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 MenuModelDelegate* menu_model_delegate_; | 200 MenuModelDelegate* menu_model_delegate_; |
| 198 | 201 |
| 199 base::WeakPtrFactory<SimpleMenuModel> method_factory_; | 202 base::WeakPtrFactory<SimpleMenuModel> method_factory_; |
| 200 | 203 |
| 201 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); | 204 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); |
| 202 }; | 205 }; |
| 203 | 206 |
| 204 } // namespace ui | 207 } // namespace ui |
| 205 | 208 |
| 206 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ | 209 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ |
| OLD | NEW |