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

Issue 1923793002: Textfield: Move selection logic from GetCommandForKeyEvent to ExecuteCommand. (Closed)

Created:
4 years, 7 months ago by karandeepb
Modified:
4 years, 7 months ago
Reviewers:
msw, Peter Kasting
CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org, chrome-apps-syd-reviews_chromium.org, Peter Kasting
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Textfield: Move selection logic from GetCommandForKeyEvent to ExecuteCommand. Currently, all logic related to an active selection, resides in GetCommandForKeyEvent. This leads to crbug.com/605492 on platforms like Linux and Mac which may bypass GetCommandForKeyEvent. This CL moves logic related to an active selection from GetCommandForKeyEvent to ExecuteCommand. This also simplifies the logic in GetCommandForKeyEvent. Also, this introduces some minor behavior changes on Windows- -Ctrl+Shift+Delete(with selection) - used to be a IDS_APP_CUT operation earlier but will now be resolved to a IDS_DELETE_FORWARD finally, similar to how Ctrl+Shift+Backspace behaves. -Shift+Delete(no selection) - used to be a IDS_DELETE_FORWARD operation earlier but will now be resolved to a IDS_APP_CUT operation (and eventually a no-op, since there is no active selection). Also added a test "DeletionWithSelection" which fails on master for MacViews. BUG=605492 TEST= On Linux and Mac, test that using a word delete keyboard shortcut in a textfield with an active selection, deletes the selected text. Committed: https://crrev.com/5e739d04c25b6f63ac9fe7f70005268006f25868 Cr-Commit-Position: refs/heads/master@{#390888}

Patch Set 1 #

Total comments: 20

Patch Set 2 : Address review comments. #

Total comments: 4

Patch Set 3 : Rebase. #

Patch Set 4 : Address review nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -9 lines) Patch
M ui/views/controls/textfield/textfield.cc View 1 2 6 chunks +25 lines, -9 lines 0 comments Download
M ui/views/controls/textfield/textfield_unittest.cc View 1 2 3 3 chunks +40 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 23 (10 generated)
karandeepb
PTAL @msw. Thanks. https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield_unittest.cc#newcode872 ui/views/controls/textfield/textfield_unittest.cc:872: TEST_F(TextfieldTest, DeletionWithSelection) { Ideally, this should ...
4 years, 7 months ago (2016-04-27 05:27:56 UTC) #5
karandeepb
ping msw@.
4 years, 7 months ago (2016-04-28 06:51:04 UTC) #6
msw
https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode140 ui/views/controls/textfield/textfield.cc:140: case ui::VKEY_DELETE: Consider rewriting this case a little bit ...
4 years, 7 months ago (2016-04-28 18:22:03 UTC) #7
Peter Kasting
https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode147 ui/views/controls/textfield/textfield.cc:147: return control ? IDS_DELETE_WORD_FORWARD : IDS_APP_CUT; On 2016/04/28 18:22:02, ...
4 years, 7 months ago (2016-04-28 19:09:18 UTC) #9
msw
https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode147 ui/views/controls/textfield/textfield.cc:147: return control ? IDS_DELETE_WORD_FORWARD : IDS_APP_CUT; On 2016/04/28 19:09:18, ...
4 years, 7 months ago (2016-04-28 19:17:43 UTC) #10
Peter Kasting
https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode147 ui/views/controls/textfield/textfield.cc:147: return control ? IDS_DELETE_WORD_FORWARD : IDS_APP_CUT; On 2016/04/28 19:17:43, ...
4 years, 7 months ago (2016-04-28 19:21:48 UTC) #11
msw
https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode147 ui/views/controls/textfield/textfield.cc:147: return control ? IDS_DELETE_WORD_FORWARD : IDS_APP_CUT; On 2016/04/28 19:21:48, ...
4 years, 7 months ago (2016-04-28 19:23:41 UTC) #12
karandeepb
PTAL msw@, pkasting@. Thanks. https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1923793002/diff/1/ui/views/controls/textfield/textfield.cc#newcode140 ui/views/controls/textfield/textfield.cc:140: case ui::VKEY_DELETE: On 2016/04/28 18:22:02, ...
4 years, 7 months ago (2016-04-29 01:40:59 UTC) #13
msw
lgtm with minor nits https://codereview.chromium.org/1923793002/diff/20001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/1923793002/diff/20001/ui/views/controls/textfield/textfield_unittest.cc#newcode872 ui/views/controls/textfield/textfield_unittest.cc:872: // Test that deletion operations ...
4 years, 7 months ago (2016-04-29 16:59:22 UTC) #14
karandeepb
https://codereview.chromium.org/1923793002/diff/20001/ui/views/controls/textfield/textfield_unittest.cc File ui/views/controls/textfield/textfield_unittest.cc (right): https://codereview.chromium.org/1923793002/diff/20001/ui/views/controls/textfield/textfield_unittest.cc#newcode872 ui/views/controls/textfield/textfield_unittest.cc:872: // Test that deletion operations behave correctly in case ...
4 years, 7 months ago (2016-05-02 03:01:42 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1923793002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1923793002/80001
4 years, 7 months ago (2016-05-02 03:03:11 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 7 months ago (2016-05-02 03:48:30 UTC) #21
commit-bot: I haz the power
4 years, 7 months ago (2016-05-02 03:49:35 UTC) #23
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/5e739d04c25b6f63ac9fe7f70005268006f25868
Cr-Commit-Position: refs/heads/master@{#390888}

Powered by Google App Engine
This is Rietveld 408576698