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

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

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 years, 5 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
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/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 bool SuggestionsMenuModel::IsCommandIdEnabled( 105 bool SuggestionsMenuModel::IsCommandIdEnabled(
106 int command_id) const { 106 int command_id) const {
107 // Please note: command_id is same as the 0-based index in |items_|. 107 // Please note: command_id is same as the 0-based index in |items_|.
108 DCHECK_GE(command_id, 0); 108 DCHECK_GE(command_id, 0);
109 DCHECK_LT(static_cast<size_t>(command_id), items_.size()); 109 DCHECK_LT(static_cast<size_t>(command_id), items_.size());
110 return items_[command_id].enabled; 110 return items_[command_id].enabled;
111 } 111 }
112 112
113 bool SuggestionsMenuModel::GetAcceleratorForCommandId(
114 int command_id,
115 ui::Accelerator* accelerator) const {
116 return false;
117 }
118
119 void SuggestionsMenuModel::ExecuteCommand(int command_id, int event_flags) { 113 void SuggestionsMenuModel::ExecuteCommand(int command_id, int event_flags) {
120 delegate_->SuggestionItemSelected(this, command_id); 114 delegate_->SuggestionItemSelected(this, command_id);
121 } 115 }
122 116
123 size_t SuggestionsMenuModel::GetItemIndex(const std::string& item_key) { 117 size_t SuggestionsMenuModel::GetItemIndex(const std::string& item_key) {
124 for (size_t i = 0; i < items_.size(); ++i) { 118 for (size_t i = 0; i < items_.size(); ++i) {
125 if (items_[i].key == item_key) 119 if (items_[i].key == item_key)
126 return i; 120 return i;
127 } 121 }
128 122
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 base::string16 YearComboboxModel::GetItemAt(int index) { 165 base::string16 YearComboboxModel::GetItemAt(int index) {
172 if (index == 0) { 166 if (index == 0) {
173 return l10n_util::GetStringUTF16( 167 return l10n_util::GetStringUTF16(
174 IDS_AUTOFILL_DIALOG_PLACEHOLDER_EXPIRY_YEAR); 168 IDS_AUTOFILL_DIALOG_PLACEHOLDER_EXPIRY_YEAR);
175 } 169 }
176 170
177 return base::IntToString16(this_year_ + index - 1); 171 return base::IntToString16(this_year_ + index - 1);
178 } 172 }
179 173
180 } // namespace autofill 174 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_models.h ('k') | chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698