Commit 19ba353a authored by Jay Harris's avatar Jay Harris Committed by Commit Bot

Stops the CustomTabBar updating if it is hidden

This fixes a messy looking update while the CustomTabBar is animating
out, and has the added benefit of preventing extra work.

Bug: 959738
Change-Id: I5a930ac3b4d0c754e6e20b15a91d71b260345846
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659660
Commit-Queue: Jay Harris <harrisjay@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669155}
parent fdd20c85
...@@ -227,6 +227,12 @@ void CustomTabBarView::TabChangedAt(content::WebContents* contents, ...@@ -227,6 +227,12 @@ void CustomTabBarView::TabChangedAt(content::WebContents* contents,
if (!contents) if (!contents)
return; return;
// If the toolbar should not be shown don't update the UI, as the toolbar may
// be animating out and it looks messy.
Browser* browser = chrome::FindBrowserWithWebContents(contents);
if (!browser->app_controller()->ShouldShowToolbar())
return;
content::NavigationEntry* entry = contents->GetController().GetVisibleEntry(); content::NavigationEntry* entry = contents->GetController().GetVisibleEntry();
base::string16 title, location; base::string16 title, location;
if (entry) { if (entry) {
......
...@@ -322,8 +322,10 @@ IN_PROC_BROWSER_TEST_F(CustomTabBarViewBrowserTest, TitleAndLocationUpdate) { ...@@ -322,8 +322,10 @@ IN_PROC_BROWSER_TEST_F(CustomTabBarViewBrowserTest, TitleAndLocationUpdate) {
ASSERT_TRUE(https_server()->Start()); ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html"); const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
const GURL& navigate_to =
https_server()->GetURL("app.com", "/ssl/blank_page.html"); // This url is out of scope, because the CustomTabBar is not updated when it
// is not shown.
const GURL& navigate_to = https_server()->GetURL("app.com", "/simple.html");
InstallPWA(app_url); InstallPWA(app_url);
......
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