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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 739513003: Accelerator Key's in the Omnibox's context menu are not visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index c2a5765370e2f82a51cbe474e44510ff98ef05a7..aa1ebfd596c92bf653abaea5b5010c873b1ee2db 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1218,7 +1218,30 @@ bool Textfield::IsCommandIdEnabled(int command_id) const {
bool Textfield::GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) {
- return false;
+ switch (command_id) {
+ case IDS_APP_UNDO:
+ *accelerator = ui::Accelerator(ui::VKEY_Z, ui::EF_CONTROL_DOWN);
+ return true;
+
+ case IDS_APP_CUT:
+ *accelerator = ui::Accelerator(ui::VKEY_X, ui::EF_CONTROL_DOWN);
+ return true;
+
+ case IDS_APP_COPY:
+ *accelerator = ui::Accelerator(ui::VKEY_C, ui::EF_CONTROL_DOWN);
+ return true;
+
+ case IDS_APP_PASTE:
+ *accelerator = ui::Accelerator(ui::VKEY_V, ui::EF_CONTROL_DOWN);
+ return true;
+
+ case IDS_APP_SELECT_ALL:
+ *accelerator = ui::Accelerator(ui::VKEY_A, ui::EF_CONTROL_DOWN);
+ return true;
+
+ default:
+ return false;
+ }
}
void Textfield::ExecuteCommand(int command_id, int event_flags) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698