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

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: Address review comments. Created 4 years, 6 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 cfa18d1299c2098d7e46ee4fe3ef00ad9063e7f4..40b15f83e154670490e7f2fe0c40853438643cc0 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1302,8 +1302,6 @@ bool Textfield::GetAcceleratorForCommandId(int command_id,
}
void Textfield::ExecuteCommand(int command_id, int event_flags) {
- DestroyTouchSelection();
-
// Some codepaths may bypass GetCommandForKeyEvent, so any selection-dependent
// modifications of the command should happen here.
if (HasSelection()) {
@@ -1319,9 +1317,13 @@ void Textfield::ExecuteCommand(int command_id, int event_flags) {
}
}
- if (!IsCommandIdEnabled(command_id))
+ // We only execute the commands enabled in Textfield::IsCommandIdEnabled
+ // below. Hence don't do a virtual IsCommandIdEnabled call.
+ if (!Textfield::IsCommandIdEnabled(command_id))
return;
+ DestroyTouchSelection();
tapted 2016/06/09 05:10:09 The comment above is good, but now the remaining g
+
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