• Lukasz Anforowicz's avatar
    Focus tab earlier for browser-initiated, //chrome-layer navigations. · 7a8180fa
    Lukasz Anforowicz authored
    This CL changes how navigations result in focusing the tab contents:
    
    1. Browser-initiated navigations:
       - Before this CL: Focus done in FocusTabAfterNavigationHelper
         which covers both OpenURL and BeginNavigation code paths.
       - After this CL: Focus done in Browser::UpdateUIForNavigationInTab
         (similarly to pre-r737502) which covers only the OpenURL code path.
    
    2. NTP-initiated navigations:
       - No change: Focus done in FocusTabAfterNavigationHelper.
    
    This CL makes sure that the text in the Omnibox is not temporarily
    selected during a navigation, by ensuring that the Omnibox is not
    focused when OmniboxViewViews::Update runs (see also
    https://crbug.com/1048742#c4 and #c5 and #c7).  Regression tests
    are added for this problem.
    
    This CL also makes sure that DevTools-initiated navigations
    (browser-initiated navigations which go through the BeginNavigation
    path) do not result in focus changes (see also
    https://crbug.com/1048591).
    
    This CL might also (speculating here) address the performance bugs
    tracked in bugs 1048333, 1048556, 1048565, 1048988, 1048988.
    
    Fixed: 1048742, 1048591
    Bug: 1048333, 1048556, 1048565, 1048988, 1048988
    Change-Id: Ia00cd9143991c260615663fae06f096e9d7cf0f7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2040234
    Commit-Queue: Peter Kasting <pkasting@chromium.org>
    Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#739179}
    7a8180fa
browser_navigator.cc 33 KB