diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 04:12:28 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 04:12:28 +0000 |
commit | ee2cebc4940fc9144cdf23cf807ef0cd1f4e3c7f (patch) | |
tree | c499de7fe39ceb4e1fc1da4b4450c54464cf08ac /ui/views/widget/native_widget_win.cc | |
parent | 537cfb7c1e3f19debbec60709f9310aa3660a80a (diff) | |
download | chromium_src-ee2cebc4940fc9144cdf23cf807ef0cd1f4e3c7f.zip chromium_src-ee2cebc4940fc9144cdf23cf807ef0cd1f4e3c7f.tar.gz chromium_src-ee2cebc4940fc9144cdf23cf807ef0cd1f4e3c7f.tar.bz2 |
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
Review URL: https://chromiumcodereview.appspot.com/13227002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/widget/native_widget_win.cc')
-rw-r--r-- | ui/views/widget/native_widget_win.cc | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index eef25f8..86d723c 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -502,16 +502,6 @@ void NativeWidgetWin::SaveFocusOnDeactivate() { } void NativeWidgetWin::RestoreFocusOnActivate() { - // Mysteriously, this only appears to be needed support restoration of focus - // to a child hwnd when restoring its top level window from the minimized - // state. If we don't do this, then ::SetFocus() to that child HWND returns - // ERROR_INVALID_PARAMETER, despite both HWNDs being of the same thread. - // See http://crbug.com/125976 - { - // Since this is a synthetic reset, we don't need to tell anyone about it. - AutoNativeNotificationDisabler disabler; - GetWidget()->GetFocusManager()->ClearFocus(); - } RestoreFocusOnEnable(); } |