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

Issue 1963563002: Views: Flip default value of CustomButton::request_focus_on_press_ to false. (Closed)

Created:
4 years, 7 months ago by karandeepb
Modified:
4 years, 7 months ago
Reviewers:
tapted, oshima, sky, sadrul, msw
CC:
chromium-reviews, tapted, msramek+watch_chromium.org, sadrul, Matt Giuca, Peter Beverloo, tfarina, mlamouri+watch-notifications_chromium.org, raymes+watch_chromium.org, davemoore+watch_chromium.org, oshima+watch_chromium.org, kalyank, markusheintz_, sync-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Views: Flip default value of CustomButton::request_focus_on_press_ to false. CustomButton::request_focus_on_press_ has a default value of true currently. Since View::RequestFocus uses IsFocusable() when keyboard accessibility is off (i.e. on Non-Mac platforms), hence only buttons with FocusBehavior::ALWAYS can actually gain focus if they have request_focus_on_press_ set to true. Most CustomButton subclasses like say ToolbarButton or TabCloseButton, which have FocusBehavior::ACCESSIBLE_ONLY, rely on this behavior and do not explicitly override request_focus_on_press_ to false. This CL corrects the request_focus_on_press_ value on the CustomButton subclasses by flipping the default value to false. Since only buttons with request_focus_on_press_ set to true and having FocusBehavior::ALWAYS are intended to gain focus on a mouse press, all ConfigureDefaultFocus call sites are examined and set_request_focus_on_press is set to the appropriate value. BUG=NONE Committed: https://crrev.com/2380985ecba0f27f2a6c7406121c76dd59ed711b Cr-Commit-Position: refs/heads/master@{#394020}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Undo unrelated changes. #

Total comments: 2

Patch Set 4 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -27 lines) Patch
M ash/shell/lock_view.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ash/system/tray/tray_popup_header_button.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/system/tray/tray_popup_label_button.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/system/user/user_view.cc View 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/options/wifi_config_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/options/wimax_config_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 3 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/profiles/profile_chooser_view.cc View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar/app_menu.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_action_view.cc View 1 chunk +2 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/website_settings/chosen_object_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/website_settings/permission_selector_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/app_list/views/app_list_item_view.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/app_list/views/folder_header_view.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/message_center/views/message_center_button_bar.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/message_center/views/notification_button.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/message_center/views/notifier_settings_view.cc View 2 chunks +1 line, -1 line 0 comments Download
M ui/message_center/views/padded_button.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/controls/button/checkbox.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/controls/button/custom_button.h View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/button/custom_button.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/controls/button/label_button.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/examples/button_example.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M ui/views/examples/tree_view_example.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M ui/views/examples/tree_view_example.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/views/examples/widget_example.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/touchui/touch_selection_menu_runner_views.cc View 1 chunk +0 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 38 (18 generated)
karandeepb
Trent, can you PTAL before I send it for owner's review. Thanks.
4 years, 7 months ago (2016-05-09 10:45:56 UTC) #3
tapted
lgtm - seems reasonable. Perhaps include a comment in the CL description for the rationale ...
4 years, 7 months ago (2016-05-10 02:57:20 UTC) #6
karandeepb
PTAL sky@. Thanks.
4 years, 7 months ago (2016-05-10 05:10:53 UTC) #9
karandeepb
+sadrul@ for ui/ review. +oshima@ for ash/ and chrome/browser/chromeos review. +msw@ for chrome/broswer/ui/views review. Let ...
4 years, 7 months ago (2016-05-11 01:00:18 UTC) #14
oshima
ash lgtm https://codereview.chromium.org/1963563002/diff/40001/ash/shell/lock_view.cc File ash/shell/lock_view.cc (right): https://codereview.chromium.org/1963563002/diff/40001/ash/shell/lock_view.cc#newcode33 ash/shell/lock_view.cc:33: views::Button::ConfigureDefaultFocus(unlock_button_); It wasn't obvious to me that ...
4 years, 7 months ago (2016-05-11 14:58:28 UTC) #17
msw
Generally the change lgtm, but I agree with oshima's renaming suggestions. Also, should Button::ConfigureDefaultFocus() automatically ...
4 years, 7 months ago (2016-05-11 19:08:47 UTC) #18
karandeepb
On 2016/05/11 19:08:47, msw wrote: > Generally the change lgtm, but I agree with oshima's ...
4 years, 7 months ago (2016-05-12 00:43:00 UTC) #20
karandeepb
ping sadrul@. https://codereview.chromium.org/1963563002/diff/40001/ash/shell/lock_view.cc File ash/shell/lock_view.cc (right): https://codereview.chromium.org/1963563002/diff/40001/ash/shell/lock_view.cc#newcode33 ash/shell/lock_view.cc:33: views::Button::ConfigureDefaultFocus(unlock_button_); On 2016/05/11 14:58:27, oshima wrote: > ...
4 years, 7 months ago (2016-05-12 00:45:28 UTC) #21
karandeepb
I am exploring a simpler patch at https://codereview.chromium.org/1973073003/. Nevertheless, I think this also improves the ...
4 years, 7 months ago (2016-05-13 09:09:16 UTC) #22
karandeepb
-
4 years, 7 months ago (2016-05-16 05:43:30 UTC) #25
karandeepb
=PTAL
4 years, 7 months ago (2016-05-16 05:44:34 UTC) #26
karandeepb
=PTAL sky@ for ui/ review.
4 years, 7 months ago (2016-05-16 05:51:34 UTC) #27
sky
I can't for the life of me LGTM this on rietveld today. Hopefully the email ...
4 years, 7 months ago (2016-05-16 17:54:33 UTC) #28
maxbogue
On 2016/05/16 17:54:33, sky wrote: > I can't for the life of me LGTM this ...
4 years, 7 months ago (2016-05-16 18:52:31 UTC) #29
sky
LGTM
4 years, 7 months ago (2016-05-16 19:07:43 UTC) #30
sky
Yay, it works! On Mon, May 16, 2016 at 11:52 AM, <maxbogue@chromium.org> wrote: > On ...
4 years, 7 months ago (2016-05-16 19:07:56 UTC) #31
karandeepb
On 2016/05/16 19:07:56, sky wrote: > Yay, it works! > > On Mon, May 16, ...
4 years, 7 months ago (2016-05-17 00:49:03 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1963563002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1963563002/80001
4 years, 7 months ago (2016-05-17 00:49:43 UTC) #35
commit-bot: I haz the power
Committed patchset #4 (id:80001)
4 years, 7 months ago (2016-05-17 02:19:49 UTC) #36
commit-bot: I haz the power
4 years, 7 months ago (2016-05-17 02:21:12 UTC) #38
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/2380985ecba0f27f2a6c7406121c76dd59ed711b
Cr-Commit-Position: refs/heads/master@{#394020}

Powered by Google App Engine
This is Rietveld 408576698