diff options
author | jered@chromium.org <jered@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 02:27:01 +0000 |
---|---|---|
committer | jered@chromium.org <jered@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 02:27:01 +0000 |
commit | bbe5b49efccc98fa80bc7c575efd6cec9e5490ed (patch) | |
tree | f2a74782546549fd63f8eec6bba4a5231f16f5b3 /ui/views/controls/textfield | |
parent | ffc9ca95aee1ebacc875e667871c914e51c668bb (diff) | |
download | chromium_src-bbe5b49efccc98fa80bc7c575efd6cec9e5490ed.zip chromium_src-bbe5b49efccc98fa80bc7c575efd6cec9e5490ed.tar.gz chromium_src-bbe5b49efccc98fa80bc7c575efd6cec9e5490ed.tar.bz2 |
views: Do not open popup on Paste+Go.
BUG=214335
TEST=Manually tested affected commands + browsertest.
Review URL: https://chromiumcodereview.appspot.com/13469011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls/textfield')
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 236dd06..f181fbf 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -756,37 +756,46 @@ void NativeTextfieldViews::ExecuteCommand(int command_id, int event_flags) { if (!IsCommandIdEnabled(command_id)) return; - bool text_changed = false; - OnBeforeUserAction(); TextfieldController* controller = textfield_->GetController(); if (controller && controller->HandlesCommand(command_id)) { controller->ExecuteCommand(command_id, 0); } else { + bool text_changed = false; switch (command_id) { case IDS_APP_CUT: + OnBeforeUserAction(); text_changed = Cut(); + UpdateAfterChange(text_changed, text_changed); + OnAfterUserAction(); break; case IDS_APP_COPY: + OnBeforeUserAction(); Copy(); + OnAfterUserAction(); break; case IDS_APP_PASTE: + OnBeforeUserAction(); text_changed = Paste(); + UpdateAfterChange(text_changed, text_changed); + OnAfterUserAction(); break; case IDS_APP_DELETE: + OnBeforeUserAction(); text_changed = model_->Delete(); + UpdateAfterChange(text_changed, text_changed); + OnAfterUserAction(); break; case IDS_APP_SELECT_ALL: + OnBeforeUserAction(); SelectAll(false); + UpdateAfterChange(false, true); + OnAfterUserAction(); break; default: controller->ExecuteCommand(command_id, 0); break; } } - - // The cursor must have changed if text changed during cut/paste/delete. - UpdateAfterChange(text_changed, text_changed); - OnAfterUserAction(); } void NativeTextfieldViews::SetColor(SkColor value) { |