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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Adds an item and its identifying key to the model. Keys needn't be unique. | 41 // Adds an item and its identifying key to the model. Keys needn't be unique. |
42 void AddKeyedItem(const std::string& key, const string16& display_label); | 42 void AddKeyedItem(const std::string& key, const string16& display_label); |
43 | 43 |
44 // As above, but also accepts an image which will be displayed alongside the | 44 // As above, but also accepts an image which will be displayed alongside the |
45 // text. | 45 // text. |
46 void AddKeyedItemWithIcon(const std::string& key, | 46 void AddKeyedItemWithIcon(const std::string& key, |
47 const string16& display_label, | 47 const string16& display_label, |
48 const gfx::Image& icon); | 48 const gfx::Image& icon); |
49 | 49 |
| 50 // Adds a label with a sub-label and its identifying key to the model. |
| 51 // Keys needn't be unique. |
| 52 void AddKeyedItemWithSublabel(const std::string& key, |
| 53 const string16& display_label, |
| 54 const string16& display_sublabel); |
| 55 |
| 56 // As above, but also accepts an image which will be displayed alongside the |
| 57 // text. |
| 58 void AddKeyedItemWithSublabelAndIcon(const std::string& key, |
| 59 const string16& display_label, |
| 60 const string16& display_sublabel, |
| 61 const gfx::Image& icon); |
| 62 |
50 // Resets the model to empty. | 63 // Resets the model to empty. |
51 void Reset(); | 64 void Reset(); |
52 | 65 |
53 // Returns the ID key for the item at |index|. | 66 // Returns the ID key for the item at |index|. |
54 std::string GetItemKeyAt(int index) const; | 67 std::string GetItemKeyAt(int index) const; |
55 | 68 |
56 // Returns the ID key for the item at |checked_item_|, or an empty string if | 69 // Returns the ID key for the item at |checked_item_|, or an empty string if |
57 // there are no items. | 70 // there are no items. |
58 std::string GetItemKeyForCheckedItem() const; | 71 std::string GetItemKeyForCheckedItem() const; |
59 | 72 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 private: | 185 private: |
173 // The current year (e.g., 2012). | 186 // The current year (e.g., 2012). |
174 int this_year_; | 187 int this_year_; |
175 | 188 |
176 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); | 189 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); |
177 }; | 190 }; |
178 | 191 |
179 } // autofill | 192 } // autofill |
180 | 193 |
181 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ | 194 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ |
OLD | NEW |