Commit 89c8d498 authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

[Nav Experiment] Use visible URL to determine NTP animation.

This removes the brief omnibox shadow when animating NTP. With slim-nav,
NTP navigation item is still pending at time of
|animateNewTab:inForegroundWithCompletion|, so using last committed item
URL will not correctly animate.

Bug: 819606
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ie6b5ecad62f67f1b380e29e2a97bae0cbc19b45a
Reviewed-on: https://chromium-review.googlesource.com/1106420Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568536}
parent 8d6c46f3
...@@ -5125,8 +5125,14 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -5125,8 +5125,14 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
CGFloat newPageOffset = 0; CGFloat newPageOffset = 0;
UIView* newPage = nil; UIView* newPage = nil;
CGFloat offset = 0; CGFloat offset = 0;
if (tab.webState->GetLastCommittedURL() == kChromeUINewTabURL && GURL tabURL = tab.webState->GetLastCommittedURL();
!_isOffTheRecord && ![self canShowTabStrip]) { // Vislble URL should be more correct here than last committed, but for
// safety, limiting the scope only to WKBasedNavigationManager, which needs
// it to correctly animate NTP. See https://crbug.com/819606.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled())
tabURL = tab.webState->GetVisibleURL();
if (tabURL == kChromeUINewTabURL && !_isOffTheRecord &&
![self canShowTabStrip]) {
offset = 0; offset = 0;
// Temporary expand content area to take whole view space. Otherwise the // Temporary expand content area to take whole view space. Otherwise the
// animated NTP will be clipped by content area bound. Previous frame will // animated NTP will be clipped by content area bound. Previous frame will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment