| 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 20 matching lines...) Expand all Loading... |
| 31 // index and item GUID. | 31 // index and item GUID. |
| 32 class SuggestionsMenuModel : public ui::SimpleMenuModel, | 32 class SuggestionsMenuModel : public ui::SimpleMenuModel, |
| 33 public ui::SimpleMenuModel::Delegate { | 33 public ui::SimpleMenuModel::Delegate { |
| 34 public: | 34 public: |
| 35 explicit SuggestionsMenuModel(SuggestionsMenuModelDelegate* delegate); | 35 explicit SuggestionsMenuModel(SuggestionsMenuModelDelegate* delegate); |
| 36 virtual ~SuggestionsMenuModel(); | 36 virtual ~SuggestionsMenuModel(); |
| 37 | 37 |
| 38 // Adds an item and its identifying key to the model. Keys needn't be unique. | 38 // Adds an item and its identifying key to the model. Keys needn't be unique. |
| 39 void AddKeyedItem(const std::string& key, const string16& display_label); | 39 void AddKeyedItem(const std::string& key, const string16& display_label); |
| 40 | 40 |
| 41 // Resets the model to empty. |
| 42 void Reset(); |
| 43 |
| 41 // Returns the ID key for the item at |index|. | 44 // Returns the ID key for the item at |index|. |
| 42 std::string GetItemKeyAt(int index) const; | 45 std::string GetItemKeyAt(int index) const; |
| 43 | 46 |
| 44 int checked_item() { return checked_item_; } | 47 int checked_item() { return checked_item_; } |
| 45 | 48 |
| 46 // ui::SimpleMenuModel::Delegate implementation. | 49 // ui::SimpleMenuModel::Delegate implementation. |
| 47 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 50 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
| 48 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 51 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
| 49 virtual bool GetAcceleratorForCommandId( | 52 virtual bool GetAcceleratorForCommandId( |
| 50 int command_id, | 53 int command_id, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 private: | 95 private: |
| 93 // The current year (e.g., 2012). | 96 // The current year (e.g., 2012). |
| 94 int this_year_; | 97 int this_year_; |
| 95 | 98 |
| 96 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); | 99 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); |
| 97 }; | 100 }; |
| 98 | 101 |
| 99 } // autofill | 102 } // autofill |
| 100 | 103 |
| 101 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ | 104 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ |
| OLD | NEW |