Commit d572640f authored by rajendrant's avatar rajendrant Committed by Commit Bot

Fix crash due to different Tab Delegate used

static_cast<TabWebContentsDelegateAndroid> maybe a problem if different
delegate got used. So using a different method to check for isCustomTab

Bug: 1117533
Change-Id: Ibf5fde78e77bfaa407538880c181c713e176cb0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363215Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: rajendrant <rajendrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799885}
parent 7f351e5f
......@@ -86,9 +86,9 @@ bool HttpsImageCompressionInfoBarDecider::CanShowInfoBar(
if (!navigation_handle->GetURL().SchemeIs(url::kHttpsScheme))
return false;
#if defined(OS_ANDROID)
auto* delegate = static_cast<android::TabWebContentsDelegateAndroid*>(
navigation_handle->GetWebContents()->GetDelegate());
if (delegate->IsCustomTab())
auto* tab_android =
TabAndroid::FromWebContents(navigation_handle->GetWebContents());
if (!tab_android || tab_android->IsCustomTab())
return false;
#endif
return true;
......
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