Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2629)

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper.cc

Issue 134333008: Allow 'continue' URL to match even if redirected to another Google TLD. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: allow subdomains off google.com for continue URLs Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index 327937055001e5900cb64786c1b66ba0d58dd3c8..1bf30e28f6062e4f3730274f019f2e7449030416 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -1242,17 +1242,25 @@ void OneClickSigninHelper::DidStopLoading(
// When Gaia finally redirects to the continue URL, Gaia will add some
// extra query parameters. So ignore the parameters when checking to see
- // if the user has continued.
+ // if the user has continued. Sometimes locales will redirect to a country-
+ // specific TLD so just make sure it's a valid domain instead of comparing
+ // for an exact match.
GURL::Replacements replacements;
replacements.ClearQuery();
const bool continue_url_match = (
- continue_url_.is_valid() &&
- url.ReplaceComponents(replacements) ==
- continue_url_.ReplaceComponents(replacements));
+ google_util::IsGoogleDomainUrl(
+ continue_url_,
+ google_util::ALLOW_SUBDOMAIN,
+ google_util::DISALLOW_NON_STANDARD_PORTS) &&
+ url.ReplaceComponents(replacements).path() ==
+ continue_url_.ReplaceComponents(replacements).path());
const bool original_continue_url_match = (
- original_continue_url_.is_valid() &&
- url.ReplaceComponents(replacements) ==
- original_continue_url_.ReplaceComponents(replacements));
+ google_util::IsGoogleDomainUrl(
+ original_continue_url_,
+ google_util::ALLOW_SUBDOMAIN,
+ google_util::DISALLOW_NON_STANDARD_PORTS) &&
+ url.ReplaceComponents(replacements).path() ==
+ original_continue_url_.ReplaceComponents(replacements).path());
if (continue_url_match)
RemoveSigninRedirectURLHistoryItem(contents);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698