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

Issue 1915863004: Remove View::focusable() - Alternate approach. (Closed)

Created:
4 years, 8 months ago by karandeepb
Modified:
4 years, 7 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove View::focusable() This CL removes View::focusable(). The existing usages of View::focusable() in the Label class are changed to use IsFocusable(). This necessiates adding labels to the view hierarchy before using their GetInsets() value in StyledLabel::CalculateAndDoLayout(), as well as resetting the label layout, whenever it is made visible or enabled.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -35 lines) Patch
M ui/views/controls/label.cc View 4 chunks +12 lines, -2 lines 1 comment Download
M ui/views/controls/styled_label.cc View 4 chunks +12 lines, -5 lines 0 comments Download
M ui/views/controls/styled_label_unittest.cc View 2 chunks +22 lines, -6 lines 0 comments Download
M ui/views/view.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/view_unittest.cc View 2 chunks +0 lines, -18 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 8 (7 generated)
karandeepb
4 years, 7 months ago (2016-04-27 23:53:17 UTC) #8
PTAL sky@. This approach uses IsFocusable. However, I don't like this approach
much, since the code in styled_label now seems a bit hacky. Maybe we can just
expose View::focus_behavior_?

https://codereview.chromium.org/1915863004/diff/80001/ui/views/controls/label.cc
File ui/views/controls/label.cc (right):

https://codereview.chromium.org/1915863004/diff/80001/ui/views/controls/label...
ui/views/controls/label.cc:338: // will return a different value. Hence reset
layout.
I am not totally sure whether this is needed or not.

Powered by Google App Engine
This is Rietveld 408576698