Commit 54148b42 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Always use visible URL for BVC new tab animations.

This CL updates BVC to always use the visible URL when calculating the
final frame of the NTP for animtions.

Bug: 880262
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Ie896009aff289b505ba3365afdc7ca9827058cd8
Reviewed-on: https://chromium-review.googlesource.com/c/1241557
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596426}
parent 7b862224
...@@ -4986,30 +4986,10 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint { ...@@ -4986,30 +4986,10 @@ applicationCommandEndpoint:(id<ApplicationCommands>)applicationCommandEndpoint {
CGFloat newPageOffset = 0; CGFloat newPageOffset = 0;
UIView* newPage = nil; UIView* newPage = nil;
CGFloat offset = 0; CGFloat offset = 0;
GURL tabURL = tab.webState->GetVisibleURL();
// Toolbar snapshot is only used for the UIRefresh animation. // Toolbar snapshot is only used for the UIRefresh animation.
UIView* toolbarSnapshot; UIView* toolbarSnapshot;
GURL tabURL = tab.webState->GetLastCommittedURL();
BOOL expectingPageLoad = NO;
if (_browserState && !_isShutdown) {
WebStateListWebUsageEnabler* webUsageEnabler =
WebStateListWebUsageEnablerFactory::GetInstance()->GetForBrowserState(
_browserState);
expectingPageLoad = webUsageEnabler->IsWebUsageEnabled() &&
webUsageEnabler->TriggersInitialLoad();
}
if (web::GetWebClient()->IsSlimNavigationManagerEnabled() ||
expectingPageLoad) {
// The visible URL is more correct here. However, the last committed URL
// has been used historically, and it's unclear if there are unintended side
// effects from from using the visible URL in all situations. In order to
// mitigate the risk from using the visible URL, additional checks are used
// here to only update the URL for known conditions in which the last-
// committed URL is incorrect.
// TODO(crbug.com/880262): Update to use visible URL for all new tabs.
tabURL = tab.webState->GetVisibleURL();
}
if (tabURL == kChromeUINewTabURL && !_isOffTheRecord && if (tabURL == kChromeUINewTabURL && !_isOffTheRecord &&
![self canShowTabStrip]) { ![self canShowTabStrip]) {
offset = 0; offset = 0;
......
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