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

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

Issue 2024893003: Views: Modify Textfield::ExecuteCommand to use Textfield::IsCommandIdEnabled instead of a virtual ca (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor1_IsEditCommandEnabled
Patch Set: Created 4 years, 7 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 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 be739e44479b1a853e7a3ec4f22db77e889bb8c5..3bfd8176efb42ae72f40c7c72e4062e9831ff489 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1302,6 +1302,9 @@ bool Textfield::GetAcceleratorForCommandId(int command_id,
}
void Textfield::ExecuteCommand(int command_id, int event_flags) {
+ if (!Textfield::IsCommandIdEnabled(command_id))
+ return;
+
DestroyTouchSelection();
// Some codepaths may bypass GetCommandForKeyEvent, so any selection-dependent
@@ -1319,9 +1322,6 @@ void Textfield::ExecuteCommand(int command_id, int event_flags) {
}
}
- if (!IsCommandIdEnabled(command_id))
- return;
-
bool text_changed = false;
bool cursor_changed = false;
bool rtl = GetTextDirection() == base::i18n::RIGHT_TO_LEFT;
« 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