• msw@chromium.org's avatar
    Revise NativeWidgetWin focus hack; force focus on restore. · ee2cebc4
    msw@chromium.org authored
    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
    ee2cebc4
bubble_delegate_unittest.cc 6.97 KB