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 CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void SetCheckedIndex(size_t index); | 77 void SetCheckedIndex(size_t index); |
78 | 78 |
79 int checked_item() const { return checked_item_; } | 79 int checked_item() const { return checked_item_; } |
80 | 80 |
81 // Enable/disable an item by key. | 81 // Enable/disable an item by key. |
82 void SetEnabled(const std::string& item_key, bool enabled); | 82 void SetEnabled(const std::string& item_key, bool enabled); |
83 | 83 |
84 // ui::SimpleMenuModel::Delegate implementation. | 84 // ui::SimpleMenuModel::Delegate implementation. |
85 bool IsCommandIdChecked(int command_id) const override; | 85 bool IsCommandIdChecked(int command_id) const override; |
86 bool IsCommandIdEnabled(int command_id) const override; | 86 bool IsCommandIdEnabled(int command_id) const override; |
87 bool GetAcceleratorForCommandId(int command_id, | |
88 ui::Accelerator* accelerator) const override; | |
89 void ExecuteCommand(int command_id, int event_flags) override; | 87 void ExecuteCommand(int command_id, int event_flags) override; |
90 | 88 |
91 private: | 89 private: |
92 // Represents an item in this model. | 90 // Represents an item in this model. |
93 struct Item { | 91 struct Item { |
94 std::string key; // The key of the item. | 92 std::string key; // The key of the item. |
95 bool enabled; // Whether the item is selectable. | 93 bool enabled; // Whether the item is selectable. |
96 }; | 94 }; |
97 // The items this model represents in presentation order. | 95 // The items this model represents in presentation order. |
98 // Note: the index in this vector is the |command_id| of the item. | 96 // Note: the index in this vector is the |command_id| of the item. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 private: | 137 private: |
140 // The current year (e.g., 2012). | 138 // The current year (e.g., 2012). |
141 int this_year_; | 139 int this_year_; |
142 | 140 |
143 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); | 141 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); |
144 }; | 142 }; |
145 | 143 |
146 } // namespace autofill | 144 } // namespace autofill |
147 | 145 |
148 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ | 146 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ |
OLD | NEW |