Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_models.h

Issue 15500008: Persist the choice of AutofillDataModel when using the requestAutocomplete dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ilya review Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 std::string GetItemKeyAt(int index) const; 65 std::string GetItemKeyAt(int index) const;
66 66
67 // Returns the ID key for the item at |checked_item_|, or an empty string if 67 // Returns the ID key for the item at |checked_item_|, or an empty string if
68 // there are no items. 68 // there are no items.
69 std::string GetItemKeyForCheckedItem() const; 69 std::string GetItemKeyForCheckedItem() const;
70 70
71 // Sets which item is checked. 71 // Sets which item is checked.
72 void SetCheckedItem(const std::string& item_key); 72 void SetCheckedItem(const std::string& item_key);
73 void SetCheckedIndex(size_t index); 73 void SetCheckedIndex(size_t index);
74 74
75 int checked_item() { return checked_item_; } 75 // Sets the item to be checked to the |n|th item that has key |item_key|.
76 // If there are fewer than |n| items that share |item_key|, the last one
77 // becomes checked. If there is no item with the key one, nothing happens.
Ilya Sherman 2013/05/21 23:20:43 nit: "with the key one" -> "with the key |item_key
Evan Stade 2013/05/22 22:24:02 Done.
78 // |n| is 1-indexed.
79 void SetCheckedItemNthWithKey(const std::string& item_key, size_t n);
80
81 int checked_item() const { return checked_item_; }
76 82
77 // ui::SimpleMenuModel::Delegate implementation. 83 // ui::SimpleMenuModel::Delegate implementation.
78 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; 84 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE;
79 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; 85 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE;
80 virtual bool GetAcceleratorForCommandId( 86 virtual bool GetAcceleratorForCommandId(
81 int command_id, 87 int command_id,
82 ui::Accelerator* accelerator) OVERRIDE; 88 ui::Accelerator* accelerator) OVERRIDE;
83 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; 89 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE;
84 90
85 private: 91 private:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 private: 132 private:
127 // The current year (e.g., 2012). 133 // The current year (e.g., 2012).
128 int this_year_; 134 int this_year_;
129 135
130 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel); 136 DISALLOW_COPY_AND_ASSIGN(YearComboboxModel);
131 }; 137 };
132 138
133 } // autofill 139 } // autofill
134 140
135 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_ 141 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_MODELS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698