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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |