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

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

Issue 12207140: re-commit r181807: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 5 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 11 matching lines...) Expand all
22 checked_item_(0) {} 22 checked_item_(0) {}
23 23
24 SuggestionsMenuModel::~SuggestionsMenuModel() {} 24 SuggestionsMenuModel::~SuggestionsMenuModel() {}
25 25
26 void SuggestionsMenuModel::AddKeyedItem( 26 void SuggestionsMenuModel::AddKeyedItem(
27 const std::string& key, const string16& item) { 27 const std::string& key, const string16& item) {
28 items_.push_back(std::make_pair(key, item)); 28 items_.push_back(std::make_pair(key, item));
29 AddCheckItem(items_.size() - 1, item); 29 AddCheckItem(items_.size() - 1, item);
30 } 30 }
31 31
32 void SuggestionsMenuModel::Reset() {
33 checked_item_ = 0;
34 items_.clear();
35 Clear();
36 }
37
32 std::string SuggestionsMenuModel::GetItemKeyAt(int index) const { 38 std::string SuggestionsMenuModel::GetItemKeyAt(int index) const {
33 return items_[index].first; 39 return items_[index].first;
34 } 40 }
35 41
36 bool SuggestionsMenuModel::IsCommandIdChecked( 42 bool SuggestionsMenuModel::IsCommandIdChecked(
37 int command_id) const { 43 int command_id) const {
38 return checked_item_ == command_id; 44 return checked_item_ == command_id;
39 } 45 }
40 46
41 bool SuggestionsMenuModel::IsCommandIdEnabled( 47 bool SuggestionsMenuModel::IsCommandIdEnabled(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 87
82 int YearComboboxModel::GetItemCount() const { 88 int YearComboboxModel::GetItemCount() const {
83 return 10; 89 return 10;
84 } 90 }
85 91
86 string16 YearComboboxModel::GetItemAt(int index) { 92 string16 YearComboboxModel::GetItemAt(int index) {
87 return base::IntToString16(this_year_ + index); 93 return base::IntToString16(this_year_ + index);
88 } 94 }
89 95
90 } // autofill 96 } // autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_models.h ('k') | chrome/browser/ui/autofill/autofill_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698