OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ | 5 #ifndef APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ |
6 #define APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ | 6 #define APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // If the button at |index| should have its size equalized along with all | 77 // If the button at |index| should have its size equalized along with all |
78 // other items that have their PartOfGroup bit set. | 78 // other items that have their PartOfGroup bit set. |
79 bool PartOfGroup(int index) const; | 79 bool PartOfGroup(int index) const; |
80 | 80 |
81 // Called from implementations. | 81 // Called from implementations. |
82 void ActivatedCommand(int command_id); | 82 void ActivatedCommand(int command_id); |
83 | 83 |
84 // Returns the enabled state of the button at |index|. | 84 // Returns the enabled state of the button at |index|. |
85 bool IsEnabledAt(int index) const; | 85 bool IsEnabledAt(int index) const; |
86 | 86 |
| 87 // Returns the enabled state of the command specified by |command_id|. |
| 88 bool IsCommandIdEnabled(int command_id) const; |
| 89 |
87 const string16& label() const { return item_label_; } | 90 const string16& label() const { return item_label_; } |
88 | 91 |
89 private: | 92 private: |
90 // The non-clickable label to the left of the buttons. | 93 // The non-clickable label to the left of the buttons. |
91 string16 item_label_; | 94 string16 item_label_; |
92 | 95 |
93 struct Item; | 96 struct Item; |
94 std::vector<Item> items_; | 97 std::vector<Item> items_; |
95 | 98 |
96 Delegate* delegate_; | 99 Delegate* delegate_; |
97 | 100 |
98 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); | 101 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); |
99 }; | 102 }; |
100 | 103 |
101 } // namespace menus | 104 } // namespace menus |
102 | 105 |
103 #endif // APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ | 106 #endif // APP_MENUS_BUTTON_MENU_ITEM_MODEL_H_ |
OLD | NEW |