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

Issue 108063004: Give up focus if the focused view becomes unfocusable (Closed)

Created:
7 years ago by mohsen
Modified:
6 years, 4 months ago
Reviewers:
sky
CC:
chromium-reviews, asanka, sadrul, nkostylev+watch_chromium.org, yoshiki+watch_chromium.org, yukishiino+watch_chromium.org, davemoore+watch_chromium.org, markusheintz_, benjhayden+dwatch_chromium.org, Ilya Sherman, yusukes+watch_chromium.org, tim+watch_chromium.org, extensions-reviews_chromium.org, alicet1, aboxhall+watch_chromium.org, stevenjb+watch_chromium.org, nona+watch_chromium.org, kalyank, dyu1, haitaol+watch_chromium.org, penghuang+watch_chromium.org, yuzo+watch_chromium.org, msw+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, ben+views_chromium.org, rouslan+autofillwatch_chromium.org, chrome-apps-syd-reviews_chromium.org, James Su, plundblad+watch_chromium.org, tfarina, benquan, Dane Wallinga, dtseng+watch_chromium.org, estade+watch_chromium.org, rsimha+watch_chromium.org, ben+ash_chromium.org, dmazzoni+watch_chromium.org
Visibility:
Public.

Description

Give up focus if the focused view becomes unfocusable A view becomes unfocusable if: - it becomes disabled; or - it becomes hidden; or - it is set to be both not focusable and not accessibility focusable. In these cases focus should be moved to the next available view, or be cleared if no view is available for focus. Also, changed View::IsFocusable() to be non-virtual. BUG=323956 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288781

Patch Set 1 #

Patch Set 2 : Rebased #

Total comments: 2

Patch Set 3 : Extracted to common code into FocusManager class #

Total comments: 6

Patch Set 4 : Return early for focusability setters #

Patch Set 5 : Try to advance focus first #

Total comments: 1

Patch Set 6 : Without renamings #

Patch Set 7 : Rebased + Some updates #

Total comments: 8

Patch Set 8 : Applied review comments #

Patch Set 9 : Made View::IsFocusable() non-virtual #

Total comments: 2

Patch Set 10 : nit #

Patch Set 11 : Return early if not focused #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -12 lines) Patch
M ui/views/controls/webview/webview.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/controls/webview/webview.cc View 1 2 3 4 5 6 7 8 2 chunks +1 line, -6 lines 0 comments Download
M ui/views/focus/focus_manager.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/focus/focus_manager.cc View 1 2 3 4 5 6 7 8 9 1 chunk +15 lines, -0 lines 0 comments Download
M ui/views/view.h View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -5 lines 0 comments Download
M ui/views/view.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +17 lines, -0 lines 2 comments Download
M ui/views/view_unittest.cc View 1 2 3 4 5 6 7 1 chunk +63 lines, -0 lines 0 comments Download
M ui/views/widget/widget_interactive_uitest.cc View 1 2 3 4 5 6 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
mohsen
The real change of this CL is in files ui/views/view.{h,cc}. The rest is just dealing ...
7 years ago (2013-12-06 23:09:03 UTC) #1
mohsen
On 2013/12/06 23:09:03, mohsen wrote: > The real change of this CL is in files ...
7 years ago (2013-12-06 23:09:57 UTC) #2
sky
https://codereview.chromium.org/108063004/diff/20001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/108063004/diff/20001/ui/views/view.cc#newcode457 ui/views/view.cc:457: if (!visible) { You have this code in a ...
7 years ago (2013-12-07 00:29:12 UTC) #3
mohsen
I have updated the code and added tests. Important files to check are: - ui/views/view.{h,cc}; ...
7 years ago (2013-12-11 20:10:12 UTC) #4
sky
https://codereview.chromium.org/108063004/diff/40001/ui/views/focus/focus_manager.cc File ui/views/focus/focus_manager.cc (right): https://codereview.chromium.org/108063004/diff/40001/ui/views/focus/focus_manager.cc#newcode356 ui/views/focus/focus_manager.cc:356: void FocusManager::ClearFocusIfUnfocusable() { Why is this clearing and not ...
7 years ago (2013-12-11 21:29:27 UTC) #5
mohsen
https://codereview.chromium.org/108063004/diff/40001/ui/views/focus/focus_manager.cc File ui/views/focus/focus_manager.cc (right): https://codereview.chromium.org/108063004/diff/40001/ui/views/focus/focus_manager.cc#newcode356 ui/views/focus/focus_manager.cc:356: void FocusManager::ClearFocusIfUnfocusable() { On 2013/12/11 21:29:29, sky wrote: > ...
7 years ago (2013-12-12 18:26:53 UTC) #6
sky
On Thu, Dec 12, 2013 at 10:26 AM, <mohsen@chromium.org> wrote: > > https://codereview.chromium.org/108063004/diff/40001/ui/views/focus/focus_manager.cc > File ...
7 years ago (2013-12-12 20:21:59 UTC) #7
mohsen
On 2013/12/12 20:21:59, sky wrote: > On Thu, Dec 12, 2013 at 10:26 AM, <mailto:mohsen@chromium.org> ...
7 years ago (2013-12-13 07:08:33 UTC) #8
sky
Can you separate this out to the name change (no functionality) first to make this ...
7 years ago (2013-12-13 17:16:23 UTC) #9
sky
I like your test, but it doesn't really cover the case I'm saying. I realize ...
7 years ago (2013-12-13 17:41:56 UTC) #10
mohsen
On 2013/12/13 17:41:56, sky wrote: > I like your test, but it doesn't really cover ...
7 years ago (2013-12-13 19:27:23 UTC) #11
mohsen
On 2013/12/13 19:27:23, mohsen wrote: > On 2013/12/13 17:41:56, sky wrote: > > I like ...
7 years ago (2013-12-13 20:19:14 UTC) #12
sky
Two options: . AdvanceFocus needs a way to advance and store, without actually attempting to ...
7 years ago (2013-12-13 21:04:08 UTC) #13
mohsen
Resurrecting an old CL! I have made some modifications. Can you take a look, please...
6 years, 4 months ago (2014-08-07 20:33:17 UTC) #14
sky
As part of this could you make IsFocusable not virtual? I think there is only ...
6 years, 4 months ago (2014-08-07 21:40:35 UTC) #15
mohsen
Please take a look, especially at changes to make IsFocusable() non-virtual, which I'm not 100% ...
6 years, 4 months ago (2014-08-08 01:32:07 UTC) #16
sky
Your changes to WebView look right to me. https://codereview.chromium.org/108063004/diff/830001/ui/views/view_unittest.cc File ui/views/view_unittest.cc (right): https://codereview.chromium.org/108063004/diff/830001/ui/views/view_unittest.cc#newcode2654 ui/views/view_unittest.cc:2654: widget.Activate(); ...
6 years, 4 months ago (2014-08-08 14:52:30 UTC) #17
mohsen
https://codereview.chromium.org/108063004/diff/830001/ui/views/view_unittest.cc File ui/views/view_unittest.cc (right): https://codereview.chromium.org/108063004/diff/830001/ui/views/view_unittest.cc#newcode2654 ui/views/view_unittest.cc:2654: widget.Activate(); On 2014/08/08 14:52:30, sky wrote: > On 2014/08/08 ...
6 years, 4 months ago (2014-08-08 17:45:07 UTC) #18
sky
For some reason I thought we have a test with a NativeWidgetPrivate subclass. I'm wrong, ...
6 years, 4 months ago (2014-08-08 19:44:00 UTC) #19
sky
Actually, don't land yet. The problem is you expect IsActive to return true forever. That ...
6 years, 4 months ago (2014-08-08 19:45:08 UTC) #20
mohsen
On 2014/08/08 19:45:08, sky wrote: > Actually, don't land yet. The problem is you expect ...
6 years, 4 months ago (2014-08-08 20:06:50 UTC) #21
sky
Perfect, LGTM then
6 years, 4 months ago (2014-08-08 21:11:24 UTC) #22
mohsen
The CQ bit was checked by mohsen@chromium.org
6 years, 4 months ago (2014-08-09 03:53:39 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mohsen@chromium.org/108063004/890001
6 years, 4 months ago (2014-08-09 03:55:01 UTC) #24
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-09 09:12:20 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-09 09:48:08 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_swarming/builds/4629)
6 years, 4 months ago (2014-08-09 09:48:10 UTC) #27
mohsen
The CQ bit was checked by mohsen@chromium.org
6 years, 4 months ago (2014-08-10 01:29:46 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mohsen@chromium.org/108063004/890001
6 years, 4 months ago (2014-08-10 01:30:22 UTC) #29
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-10 03:20:30 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-10 04:00:11 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/2655) linux_chromium_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_swarming/builds/4696)
6 years, 4 months ago (2014-08-10 04:00:14 UTC) #32
mohsen
I have added another early return for when the view that might need to lose ...
6 years, 4 months ago (2014-08-11 06:12:01 UTC) #33
sky
https://codereview.chromium.org/108063004/diff/950001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/108063004/diff/950001/ui/views/view.cc#newcode2383 ui/views/view.cc:2383: if (IsAccessibilityFocusable() || !HasFocus()) HasFocus has to walk the ...
6 years, 4 months ago (2014-08-11 16:10:51 UTC) #34
mohsen
https://codereview.chromium.org/108063004/diff/950001/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/108063004/diff/950001/ui/views/view.cc#newcode2383 ui/views/view.cc:2383: if (IsAccessibilityFocusable() || !HasFocus()) On 2014/08/11 16:10:51, sky wrote: ...
6 years, 4 months ago (2014-08-11 16:30:00 UTC) #35
sky
Agreed. I thought you had that check in the FM, but it doesn't make sense ...
6 years, 4 months ago (2014-08-11 18:59:21 UTC) #36
sky
LGTM
6 years, 4 months ago (2014-08-11 18:59:31 UTC) #37
mohsen
The CQ bit was checked by mohsen@chromium.org
6 years, 4 months ago (2014-08-11 19:07:39 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mohsen@chromium.org/108063004/950001
6 years, 4 months ago (2014-08-11 19:16:30 UTC) #39
commit-bot: I haz the power
6 years, 4 months ago (2014-08-11 20:11:40 UTC) #40
Message was sent while issue was closed.
Change committed as 288781

Powered by Google App Engine
This is Rietveld 408576698