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

Issue 23475012: Fixes focus traversal bug (Closed)

Created:
7 years, 3 months ago by sky
Modified:
7 years, 3 months ago
Reviewers:
dmazzoni
CC:
chromium-reviews, tfarina
Visibility:
Public.

Description

Fixes focus traversal bug When on the last focusable view in a Container FocusManager would start searching from Widget. Problem is child Widgets share the same FocusManager, meaning focus in a child widget wraps to the parent, which is unexpected in most situations. In theory there could be situations where we should wrap to the parent, but I don't think we have any. BUG=276213 TEST=covered by test R=dmazzoni@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=221437

Patch Set 1 #

Patch Set 2 : Better docs #

Total comments: 2

Patch Set 3 : Better test coverage #

Patch Set 4 : ShouldAdvanceFocusToParent #

Total comments: 6

Patch Set 5 : ShouldAdvanceFocusToTopLevelWidget #

Total comments: 1

Patch Set 6 : Comments #

Patch Set 7 : OVERRIDE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+118 lines, -10 lines) Patch
M ui/views/focus/focus_manager.h View 1 2 3 4 5 1 chunk +10 lines, -2 lines 0 comments Download
M ui/views/focus/focus_manager.cc View 1 2 3 4 4 chunks +10 lines, -5 lines 0 comments Download
M ui/views/focus/focus_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +81 lines, -0 lines 0 comments Download
M ui/views/widget/widget.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/widget/widget.cc View 1 2 3 4 5 1 chunk +6 lines, -1 line 0 comments Download
M ui/views/widget/widget_delegate.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M ui/views/widget/widget_delegate.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
sky
7 years, 3 months ago (2013-08-31 00:15:44 UTC) #1
dmazzoni
lgtm https://codereview.chromium.org/23475012/diff/3001/ui/views/focus/focus_manager_unittest.cc File ui/views/focus/focus_manager_unittest.cc (right): https://codereview.chromium.org/23475012/diff/3001/ui/views/focus/focus_manager_unittest.cc#newcode857 ui/views/focus/focus_manager_unittest.cc:857: GetFocusManager()->AdvanceFocus(false); Also cycle in the reverse direction for ...
7 years, 3 months ago (2013-09-03 16:33:57 UTC) #2
sky
https://codereview.chromium.org/23475012/diff/3001/ui/views/focus/focus_manager_unittest.cc File ui/views/focus/focus_manager_unittest.cc (right): https://codereview.chromium.org/23475012/diff/3001/ui/views/focus/focus_manager_unittest.cc#newcode857 ui/views/focus/focus_manager_unittest.cc:857: GetFocusManager()->AdvanceFocus(false); On 2013/09/03 16:33:57, Dominic Mazzoni wrote: > Also ...
7 years, 3 months ago (2013-09-03 16:48:16 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/23475012/8001
7 years, 3 months ago (2013-09-03 16:48:49 UTC) #4
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) views_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=74978
7 years, 3 months ago (2013-09-03 18:56:19 UTC) #5
sky
Turns out we have some widgets that don't want the new behavior (say the find ...
7 years, 3 months ago (2013-09-04 20:09:55 UTC) #6
sky
Take another look?
7 years, 3 months ago (2013-09-04 20:10:01 UTC) #7
dmazzoni
If the Find bar is the only special case, would it make more sense to ...
7 years, 3 months ago (2013-09-04 20:40:54 UTC) #8
sky
https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.cc File ui/views/focus/focus_manager.cc (right): https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.cc#newcode312 ui/views/focus/focus_manager.cc:312: widget = widget_; On 2013/09/04 20:40:54, Dominic Mazzoni wrote: ...
7 years, 3 months ago (2013-09-04 20:50:28 UTC) #9
dmazzoni
lgtm https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.h File ui/views/focus/focus_manager.h (right): https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.h#newcode313 ui/views/focus/focus_manager.h:313: // |starting_view| and |starting_widget| are NULL, traversal starts ...
7 years, 3 months ago (2013-09-04 21:07:16 UTC) #10
sky
https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.h File ui/views/focus/focus_manager.h (right): https://codereview.chromium.org/23475012/diff/27001/ui/views/focus/focus_manager.h#newcode313 ui/views/focus/focus_manager.h:313: // |starting_view| and |starting_widget| are NULL, traversal starts at ...
7 years, 3 months ago (2013-09-04 21:10:03 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/23475012/38001
7 years, 3 months ago (2013-09-04 21:12:48 UTC) #12
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 3 months ago (2013-09-04 22:05:22 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/23475012/55001
7 years, 3 months ago (2013-09-04 22:10:22 UTC) #14
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) ui_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=82758
7 years, 3 months ago (2013-09-04 23:14:16 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/23475012/55001
7 years, 3 months ago (2013-09-05 15:32:05 UTC) #16
commit-bot: I haz the power
7 years, 3 months ago (2013-09-05 15:40:36 UTC) #17
Message was sent while issue was closed.
Change committed as 221437

Powered by Google App Engine
This is Rietveld 408576698