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

Unified Diff: components/autofill/content/browser/wallet/wallet_service_url.cc

Issue 123363002: rAc: don't open sign in continue url in new tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit test Created 6 years, 12 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
Index: components/autofill/content/browser/wallet/wallet_service_url.cc
diff --git a/components/autofill/content/browser/wallet/wallet_service_url.cc b/components/autofill/content/browser/wallet/wallet_service_url.cc
index c5397635cdb1328564dc7b4029ab3e14278c88ee..75c6d098a5eeab4aa8bcbe9500c6b330abad1fde 100644
--- a/components/autofill/content/browser/wallet/wallet_service_url.cc
+++ b/components/autofill/content/browser/wallet/wallet_service_url.cc
@@ -10,8 +10,11 @@
#include "base/format_macros.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/common/autofill_switches.h"
+#include "content/public/common/url_constants.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
@@ -154,8 +157,8 @@ GURL GetSignInContinueUrl() {
}
bool IsSignInContinueUrl(const GURL& url, size_t* user_index) {
- GURL final_url = wallet::GetSignInContinueUrl();
- if (!url.SchemeIsSecure() ||
+ GURL final_url = GetSignInContinueUrl();
+ if (url.scheme() != final_url.scheme() ||
url.host() != final_url.host() ||
url.path() != final_url.path()) {
return false;
@@ -179,7 +182,12 @@ bool IsSignInContinueUrl(const GURL& url, size_t* user_index) {
}
bool IsSignInRelatedUrl(const GURL& url) {
- return url.GetOrigin() == GetSignInUrl().GetOrigin();
+ size_t unused;
+ return url.GetOrigin() == GetSignInUrl().GetOrigin() ||
+ StartsWith(base::UTF8ToUTF16(url.GetOrigin().host()),
+ base::ASCIIToUTF16("accounts."),
+ false) ||
+ IsSignInContinueUrl(url, &unused);
}
bool IsUsingProd() {

Powered by Google App Engine
This is Rietveld 408576698