Commit ab6115c9 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Restrict GAIA cookie restore logic to a subset of Google domains.

The Google homepage and Search present consent notifications when the
user is signed out. Since GAIA restore logic currently works on a user
refresh then avoid triggering restore when the content area UI may
conflict with the sign-in notification.

Bug: 1131027, 1149902
Change-Id: I4d2b186f126c7fc14f8595062a08bb0fb72212d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2540671
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Reviewed-by: default avatarJérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828222}
parent 269f7161
...@@ -165,13 +165,20 @@ void AccountConsistencyHandler::ShouldAllowResponse( ...@@ -165,13 +165,20 @@ void AccountConsistencyHandler::ShouldAllowResponse(
if (google_util::IsGoogleDomainUrl( if (google_util::IsGoogleDomainUrl(
url, google_util::ALLOW_SUBDOMAIN, url, google_util::ALLOW_SUBDOMAIN,
google_util::DISALLOW_NON_STANDARD_PORTS)) { google_util::DISALLOW_NON_STANDARD_PORTS)) {
// Reset boolean that tracks displaying the sign-in notification infobar. // TODO(crbug.com/1131027): Disable GAIA cookie restore on Google URLs that
// This ensures that only the most recent navigation will trigger an // may display cookie consent in the content area that conflict with the
// infobar. // sign-in notification. This will be removed once we perform cookie
gaia_cookies_restored_ = false; // restoration before sending a navigation request.
account_consistency_service_->SetGaiaCookiesIfDeleted( if (!(google_util::IsGoogleHomePageUrl(url) ||
base::BindOnce(&AccountConsistencyHandler::MarkGaiaCookiesRestored, google_util::IsGoogleSearchUrl(url))) {
weak_ptr_factory_.GetWeakPtr())); // Reset boolean that tracks displaying the sign-in notification infobar.
// This ensures that only the most recent navigation will trigger an
// infobar.
gaia_cookies_restored_ = false;
account_consistency_service_->SetGaiaCookiesIfDeleted(
base::BindOnce(&AccountConsistencyHandler::MarkGaiaCookiesRestored,
weak_ptr_factory_.GetWeakPtr()));
}
} }
if (!gaia::IsGaiaSignonRealm(url.GetOrigin())) { if (!gaia::IsGaiaSignonRealm(url.GetOrigin())) {
......
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