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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. 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
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/examples/menu_example.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 bool Textfield::IsCommandIdChecked(int command_id) const { 1172 bool Textfield::IsCommandIdChecked(int command_id) const {
1173 return true; 1173 return true;
1174 } 1174 }
1175 1175
1176 bool Textfield::IsCommandIdEnabled(int command_id) const { 1176 bool Textfield::IsCommandIdEnabled(int command_id) const {
1177 return Textfield::IsTextEditCommandEnabled( 1177 return Textfield::IsTextEditCommandEnabled(
1178 GetTextEditCommandFromMenuCommand(command_id, HasSelection())); 1178 GetTextEditCommandFromMenuCommand(command_id, HasSelection()));
1179 } 1179 }
1180 1180
1181 bool Textfield::GetAcceleratorForCommandId(int command_id, 1181 bool Textfield::GetAcceleratorForCommandId(int command_id,
1182 ui::Accelerator* accelerator) { 1182 ui::Accelerator* accelerator) const {
1183 switch (command_id) { 1183 switch (command_id) {
1184 case IDS_APP_UNDO: 1184 case IDS_APP_UNDO:
1185 *accelerator = ui::Accelerator(ui::VKEY_Z, ui::EF_CONTROL_DOWN); 1185 *accelerator = ui::Accelerator(ui::VKEY_Z, ui::EF_CONTROL_DOWN);
1186 return true; 1186 return true;
1187 1187
1188 case IDS_APP_CUT: 1188 case IDS_APP_CUT:
1189 *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN); 1189 *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN);
1190 return true; 1190 return true;
1191 1191
1192 case IDS_APP_COPY: 1192 case IDS_APP_COPY:
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 RequestFocus(); 1968 RequestFocus();
1969 model_->MoveCursorTo(mouse); 1969 model_->MoveCursorTo(mouse);
1970 if (!selection_clipboard_text.empty()) { 1970 if (!selection_clipboard_text.empty()) {
1971 model_->InsertText(selection_clipboard_text); 1971 model_->InsertText(selection_clipboard_text);
1972 UpdateAfterChange(true, true); 1972 UpdateAfterChange(true, true);
1973 } 1973 }
1974 OnAfterUserAction(); 1974 OnAfterUserAction();
1975 } 1975 }
1976 1976
1977 } // namespace views 1977 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/examples/menu_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698