• François Doray's avatar
    Revert "Focus tab contents in BeginNavigation case of NTP-initiated navigations." · 69c59008
    François Doray authored
    This reverts commit b4d501e3.
    
    Reason for revert: This CL is on the blame list of the first
    failures observed for PortalBrowserTest.FocusTransfersAcrossActivation
    on Mac, and it is related to focus.
    
    Original change's description:
    > Focus tab contents in BeginNavigation case of NTP-initiated navigations.
    > 
    > Tab contents may get focused during some renderer-initiated navigations
    > (e.g. navigations from an NTP-replacement extension - see the regression
    > test added in r723022).  This CL ensures that the focus decision is
    > applied not only to navigations that go through OpenURL, but also to
    > navigations that go through (more freqeuent, usual) BeginNavigation.
    > This change helps ensure that we retain the right focus behavior after
    > more navigations switch to the BeginNavigation code path (e.g. after
    > relanding ShouldFork removal in https://crrev.com/c/1949448).
    > 
    > The CL covers both the OpenURL and BeginNavigation code paths by
    > handling the focus decisions in a newly added TabContentFocusingHelper
    > class (replicating/moving the focus decisions from OpenURL-only
    > Browser::UpdateUIForNavigationInTab).  Adding a new tab-helper class is
    > useful, because the existing, OpenURL/BeginNavigation-shared navigation
    > notifications handlers (e.g. Browser::ScheduleUIUpdate) cannot
    > distinguish between replaceState and new navigations (see also new steps
    > in the OmniboxFocusInteractiveTest.NtpReplacementExtension test).
    > 
    > While this CL changes how focus behavior is implemented, it should have
    > no effect on end-to-end/high-level expectations of focus behavior (as
    > observed by end users or browser tests).
    > 
    > browser_tests do not guarantee window activation and/or focus, but before this
    > CL navigation in browser_tests would focus WebContents.  This is not happening
    > after this CL, and requires moving a handful of focus-dependent tests from
    > browser_tests to interactive_ui_tests.
    > 
    > Bug: 1029161
    > Change-Id: Ib57c260b2f85f276ff1dad3aabedd59d1d864c8a
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1970834
    > Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    > Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
    > Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
    > Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
    > Reviewed-by: Bill Budge <bbudge@chromium.org>
    > Reviewed-by: Peter Kasting <pkasting@chromium.org>
    > Reviewed-by: Charlie Reis <creis@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#735048}
    
    TBR=pkasting@chromium.org,bbudge@chromium.org,creis@chromium.org,rouslan@chromium.org,lukasza@chromium.org,karandeepb@chromium.org,bsheedy@chromium.org
    
    Change-Id: I43362d7689548761154b80b72a0734ca02569794
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 1029161, 1045594
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020862Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
    Commit-Queue: François Doray <fdoray@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#735100}
    69c59008
ntp_overridden_bubble_delegate.h 3.02 KB