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

Issue 2024893003: Views: Modify Textfield::ExecuteCommand to use Textfield::IsCommandIdEnabled instead of a virtual ca (Closed)

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

Description

Views: Modify Textfield::ExecuteCommand to use Textfield::IsCommandIdEnabled instead of a virtual call. Textfield::ExecuteCommand is currently using a virtual IsCommandIdEnabled call. It doesn't make sense to use a virtual call since Textfield::ExecuteCommand should not be concerned with commands enabled in subclasses. Hence this CL modifies Textfield::ExecuteCommand to use Textfield::IsCommandIdEnabled instead of a virtual call BUG=586985

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Patch Set 3 : Address review comments. #

Patch Set 4 : Address review comments. #

Total comments: 1

Patch Set 5 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -1 line) Patch
M ui/views/controls/textfield/textfield.cc View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 13 (5 generated)
tapted
https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc#newcode1316 ui/views/controls/textfield/textfield.cc:1316: command_id = IDS_DELETE_BACKWARD; The command_id can change down here, ...
4 years, 6 months ago (2016-06-06 07:26:16 UTC) #3
karandeepb
PTAL Thanks. https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc#newcode1316 ui/views/controls/textfield/textfield.cc:1316: command_id = IDS_DELETE_BACKWARD; On 2016/06/06 07:26:16, tapted ...
4 years, 6 months ago (2016-06-08 03:05:49 UTC) #5
tapted
https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc#newcode1316 ui/views/controls/textfield/textfield.cc:1316: command_id = IDS_DELETE_BACKWARD; On 2016/06/08 03:05:49, karandeepb wrote: > ...
4 years, 6 months ago (2016-06-08 04:02:40 UTC) #6
karandeepb
On 2016/06/08 04:02:40, tapted wrote: > https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc > File ui/views/controls/textfield/textfield.cc (right): > > https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc#newcode1316 > ...
4 years, 6 months ago (2016-06-09 01:37:56 UTC) #8
tapted
On 2016/06/09 01:37:56, karandeepb wrote: > On 2016/06/08 04:02:40, tapted wrote: > > > https://codereview.chromium.org/2024893003/diff/1/ui/views/controls/textfield/textfield.cc ...
4 years, 6 months ago (2016-06-09 02:10:05 UTC) #9
karandeepb
On 2016/06/09 02:10:05, tapted wrote: > On 2016/06/09 01:37:56, karandeepb wrote: > > On 2016/06/08 ...
4 years, 6 months ago (2016-06-09 03:14:57 UTC) #10
tapted
make sure you update the CL description too https://codereview.chromium.org/2024893003/diff/60001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2024893003/diff/60001/ui/views/controls/textfield/textfield.cc#newcode1325 ui/views/controls/textfield/textfield.cc:1325: DestroyTouchSelection(); ...
4 years, 6 months ago (2016-06-09 05:10:09 UTC) #11
karandeepb
4 years, 6 months ago (2016-06-09 06:28:42 UTC) #12
On 2016/06/09 05:10:09, tapted wrote:
> make sure you update the CL description too
> 
>
https://codereview.chromium.org/2024893003/diff/60001/ui/views/controls/textf...
> File ui/views/controls/textfield/textfield.cc (right):
> 
>
https://codereview.chromium.org/2024893003/diff/60001/ui/views/controls/textf...
> ui/views/controls/textfield/textfield.cc:1325: DestroyTouchSelection();
> The comment above is good, but now the remaining goal is to convince the code
> reviewer that moving `DestroyTouchSelection()` to come after the check is the
> right thing to do.
> 
> The description for http://crrev.com/267813 says "Whenever a mouse or keyboard
> event happens anywhere in any display, touch text seleciton should be
> deactivated.". That suggests to me that it might belong above the check
> regardless of whether the command is enabled, but also that we might want to
> duplicate the call to DestroyTouchSelection() inside ExecuteEditCommand (also
> before checking whether the command_id is enabled) since the codepaths for
menus
> and edit commands will have less overlap.

Yeah I am also not sure. Will see what the owners have to say.

Powered by Google App Engine
This is Rietveld 408576698