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

Issue 13227002: Revise NativeWidgetWin focus hack; force focus on restore. (Closed)

Created:
7 years, 9 months ago by msw
Modified:
7 years, 8 months ago
CC:
chromium-reviews, tfarina, James Su, ben+watch_chromium.org, penghuang+watch_chromium.org, yusukes+watch_chromium.org, Nico, sky
Visibility:
Public.

Description

Revise NativeWidgetWin focus hack; force focus on restore. Remove NativeWidgetWin::RestoreFocusOnActivate's built-in hack. Always use kReasonFocusRestore in FocusManager::RestoreFocusedView(). Always run FocusManager::SetFocusedViewWithReason with kReasonFocusRestore. (this clears and resets child HWND focus, needed for the hack) Fixes initial omnibox focus on Win with --enable-views-textfield; plus: interactive_ui_tests.exe --gtest_filter=BrowserFocusTest.ClickingMovesFocus --enable-views-textfield views_unittests.exe --gtest_filter=BubbleDelegateTest.InitiallyFocusedView --enable-views-textfield (test updated to have the proper expectation, removing a non-Aura Win hack) Doesn't regress child HWND focus like the previous attempt: http://crrev.com/186235 Remove SearchTextfieldView Textfield subclass; make RequestFocus non-virtual. TODO(followup): Polish find-bar focus behavior as needed in followups. BUG=125976, 131660, 224591, 225963 TEST=View and web-contents focus restoration on minimize/restore; repro steps in bugs. Find bar works as expected (may need attention in followups). Tests pass with --enable-views-textfield. R=ben@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192493

Patch Set 1 : ClearNativeFocus in NativeWidgetWin hack; force focus change with kReasonFocusRestore. #

Patch Set 2 : Remove unnecessary SearchTextfieldView; make RequestFocus non-virtual. #

Patch Set 3 : Restore the intent of the focusable view check. #

Patch Set 4 : Sync and rebase, keep BubbleDelegateTest fix. #

Patch Set 5 : Remove IsAccessibilityFocusable check; WebView is not focusable. #

Patch Set 6 : Remove ClearNativeFocus call; move comment; refactor RestoreFocusedView. #

Patch Set 7 : Re-enable BrowserFocusTest.BrowsersRememberFocus. #

Patch Set 8 : Add ChromeOS exception for BrowserFocusTest.BrowsersRememberFocus #

Patch Set 9 : Restore FocusManager::RestoreFocusedView return values. #

Total comments: 2

Patch Set 10 : Update test comment. #

Total comments: 2

Patch Set 11 : Keep BrowserFocusTest.BrowsersRememberFocus disabled. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -49 lines) Patch
M chrome/browser/ui/views/find_bar_view.h View 1 1 chunk +1 line, -14 lines 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 chunks +1 line, -14 lines 2 comments Download
M ui/views/bubble/bubble_delegate_unittest.cc View 1 2 3 1 chunk +2 lines, -8 lines 0 comments Download
M ui/views/view.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M ui/views/widget/native_widget_win.cc View 1 2 3 4 5 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
msw
Ben, please take a look at your earliest convenience; thanks! Karen mentioned that a fix ...
7 years, 9 months ago (2013-03-28 23:34:22 UTC) #1
Ben Goodger (Google)
lgtm
7 years, 8 months ago (2013-03-29 15:17:06 UTC) #2
msw
I'm going to revert http://crrev.com/186235 on ToT, then merge that to branch 1453 for M27 ...
7 years, 8 months ago (2013-03-29 16:22:20 UTC) #3
msw
Hey Ben, please take another look at this revised CL; thanks!
7 years, 8 months ago (2013-04-02 15:14:03 UTC) #4
Ben Goodger (Google)
https://codereview.chromium.org/13227002/diff/44001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/13227002/diff/44001/chrome/browser/ui/browser_focus_uitest.cc#newcode260 chrome/browser/ui/browser_focus_uitest.cc:260: // Chrome OS currently focuses the tab content on ...
7 years, 8 months ago (2013-04-02 20:32:14 UTC) #5
msw
On 2013/04/02 20:32:14, Ben Goodger (Google) wrote: > https://codereview.chromium.org/13227002/diff/44001/chrome/browser/ui/browser_focus_uitest.cc > File chrome/browser/ui/browser_focus_uitest.cc (right): > > ...
7 years, 8 months ago (2013-04-02 20:46:55 UTC) #6
msw
It's tangential regression; please take another look. https://codereview.chromium.org/13227002/diff/44001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/13227002/diff/44001/chrome/browser/ui/browser_focus_uitest.cc#newcode260 chrome/browser/ui/browser_focus_uitest.cc:260: // Chrome ...
7 years, 8 months ago (2013-04-03 01:54:16 UTC) #7
James Cook
On 2013/04/03 01:54:16, msw wrote: > It's tangential regression; please take another look. > > ...
7 years, 8 months ago (2013-04-03 02:19:35 UTC) #8
Ben Goodger (Google)
https://codereview.chromium.org/13227002/diff/50001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/13227002/diff/50001/chrome/browser/ui/browser_focus_uitest.cc#newcode261 chrome/browser/ui/browser_focus_uitest.cc:261: ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); can you tackle this in a different CL ...
7 years, 8 months ago (2013-04-03 17:54:32 UTC) #9
msw
https://codereview.chromium.org/13227002/diff/50001/chrome/browser/ui/browser_focus_uitest.cc File chrome/browser/ui/browser_focus_uitest.cc (right): https://codereview.chromium.org/13227002/diff/50001/chrome/browser/ui/browser_focus_uitest.cc#newcode261 chrome/browser/ui/browser_focus_uitest.cc:261: ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); On 2013/04/03 17:54:32, Ben Goodger (Google) wrote: > ...
7 years, 8 months ago (2013-04-03 17:57:44 UTC) #10
msw
I reverted changes to that file, leaving the test disabled. Please take another look.
7 years, 8 months ago (2013-04-03 18:36:58 UTC) #11
msw
Ping: Ben, please take another look; thanks!
7 years, 8 months ago (2013-04-04 16:15:15 UTC) #12
Ben Goodger (Google)
lgtm
7 years, 8 months ago (2013-04-04 16:54:22 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 17:01:54 UTC) #14
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 17:10:44 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 17:25:44 UTC) #16
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 17:43:25 UTC) #17
msw
On 2013/04/04 17:43:25, I haz the power (commit-bot) wrote: > Step "update" is always a ...
7 years, 8 months ago (2013-04-04 17:50:15 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 17:51:03 UTC) #19
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 19:42:02 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 19:44:39 UTC) #21
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 19:47:58 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 19:48:58 UTC) #23
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 19:51:30 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/13227002/32002
7 years, 8 months ago (2013-04-04 22:54:58 UTC) #25
commit-bot: I haz the power
Change committed as 192493
7 years, 8 months ago (2013-04-05 04:12:30 UTC) #26
Finnur
https://chromiumcodereview.appspot.com/13227002/diff/32002/chrome/browser/ui/views/find_bar_view.cc File chrome/browser/ui/views/find_bar_view.cc (left): https://chromiumcodereview.appspot.com/13227002/diff/32002/chrome/browser/ui/views/find_bar_view.cc#oldcode511 chrome/browser/ui/views/find_bar_view.cc:511: SelectAll(true); I believe this CL regresses a long standing ...
7 years, 8 months ago (2013-04-16 18:11:28 UTC) #27
msw
7 years, 8 months ago (2013-04-17 07:12:52 UTC) #28
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/13227002/diff/32002/chrome/browser/ui/...
File chrome/browser/ui/views/find_bar_view.cc (left):

https://chromiumcodereview.appspot.com/13227002/diff/32002/chrome/browser/ui/...
chrome/browser/ui/views/find_bar_view.cc:511: SelectAll(true);
On 2013/04/16 18:11:28, Finnur wrote:
> I believe this CL regresses a long standing Find in page behavior.
> 
> Repro:
> 1) Open Chrome (one tab open).
> 2) Search for 'a'.
> 3) Open another tab.
> 4) Search for 'b' in that tab.
> 5) Set focus to the Omnibox.
> 6) Switch to tab 'a'.
> 7) Make sure the Find box is focused *and* 'a' is highlighted (so you can
> overwrite the Find query).
> 
> There used to be an interactive test covering this (FocusRestoreOnTabSwitch),
> but it got disabled due to flakiness. Btw: it can be deflaked by adding a call
> to:
>   browser()->tab_strip_model()->ActivateTabAt(0, true);
> ... right before the first GetFindSelectedText() call.

Thanks, Finnur! I filed http://crbug.com/232290 and have a fix in progress.

Powered by Google App Engine
This is Rietveld 408576698