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

Unified Diff: chrome/browser/signin/signin_promo.cc

Issue 872433006: Disconnect one click sign in code. The code itself will be removed in followup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge Created 5 years, 10 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 | « chrome/browser/signin/signin_promo.h ('k') | chrome/browser/signin/signin_tracker_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_promo.cc
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
index eed310afe70d4f0491922781a63df6cd6a68d97d..a3404a91322bbbaf40d6d4c83b5c345915c9cf65 100644
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -42,11 +42,6 @@ using content::WebContents;
namespace {
-// Gaia cannot support about:blank as a continue URL, so using a hosted blank
-// page instead.
-const char kSignInLandingUrlPrefix[] =
- "https://www.google.com/intl/%s/chrome/blank.html";
-
// The maximum number of times we want to show the sign in promo at startup.
const int kSignInPromoShowAtStartupMaximum = 10;
@@ -161,15 +156,10 @@ void SetUserSkippedPromo(Profile* profile) {
}
GURL GetLandingURL(const char* option, int value) {
- std::string url;
- if (switches::IsEnableWebBasedSignin()) {
- const std::string& locale = g_browser_process->GetApplicationLocale();
- url = base::StringPrintf(kSignInLandingUrlPrefix, locale.c_str());
- } else {
- url = base::StringPrintf(
- "%s/success.html", extensions::kGaiaAuthExtensionOrigin);
- }
- base::StringAppendF(&url, "?%s=%d", option, value);
+ std::string url = base::StringPrintf("%s/success.html?%s=%d",
+ extensions::kGaiaAuthExtensionOrigin,
+ option,
+ value);
return GURL(url);
}
@@ -182,44 +172,13 @@ GURL GetPromoURL(signin_metrics::Source source,
bool is_constrained) {
DCHECK_NE(signin_metrics::SOURCE_UNKNOWN, source);
- if (!switches::IsEnableWebBasedSignin()) {
- std::string url(chrome::kChromeUIChromeSigninURL);
- base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source);
- if (auto_close)
- base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyAutoClose);
- if (is_constrained)
- base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyConstrained);
- return GURL(url);
- }
-
- // Build a Gaia-based URL that can be used to sign the user into chrome.
- // There are required request parameters:
- //
- // - tell Gaia which service the user is signing into. In this case,
- // a chrome sign in uses the service "chromiumsync"
- // - provide a continue URL. This is the URL that Gaia will redirect to
- // once the sign is complete.
- //
- // The continue URL includes a source parameter that can be extracted using
- // the function GetSourceForSignInPromoURL() below. This is used to know
- // which of the chrome sign in access points was used to sign the user in.
- // It is also parsed for the |auto_close| flag, which indicates that the tab
- // must be closed after sync setup is successful.
- // See OneClickSigninHelper for details.
- std::string query_string = "?service=chromiumsync&sarp=1";
-
- std::string continue_url = GetLandingURL(kSignInPromoQueryKeySource,
- static_cast<int>(source)).spec();
+ std::string url(chrome::kChromeUIChromeSigninURL);
+ base::StringAppendF(&url, "?%s=%d", kSignInPromoQueryKeySource, source);
if (auto_close)
- base::StringAppendF(&continue_url, "&%s=1", kSignInPromoQueryKeyAutoClose);
-
- base::StringAppendF(
- &query_string,
- "&%s=%s",
- kSignInPromoQueryKeyContinue,
- net::EscapeQueryParamValue(continue_url, false).c_str());
-
- return GaiaUrls::GetInstance()->service_login_url().Resolve(query_string);
+ base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyAutoClose);
+ if (is_constrained)
+ base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyConstrained);
+ return GURL(url);
}
GURL GetReauthURL(Profile* profile, const std::string& account_id) {
@@ -227,13 +186,6 @@ GURL GetReauthURL(Profile* profile, const std::string& account_id) {
AccountTrackerServiceFactory::GetForProfile(profile)->
GetAccountInfo(account_id);
- if (switches::IsEnableWebBasedSignin()) {
- return net::AppendQueryParameter(
- signin::GetPromoURL(signin_metrics::SOURCE_SETTINGS, true),
- "Email",
- account_id);
- }
-
signin_metrics::Source source = switches::IsNewAvatarMenu() ?
signin_metrics::SOURCE_REAUTH : signin_metrics::SOURCE_SETTINGS;
@@ -257,9 +209,7 @@ GURL GetNextPageURLForPromoURL(const GURL& url) {
}
GURL GetSigninPartitionURL() {
- return GURL(switches::IsEnableWebviewBasedSignin() ?
- "chrome-guest://chrome-signin/?" :
- chrome::kChromeUIChromeSigninURL);
+ return GURL("chrome-guest://chrome-signin/?");
}
signin_metrics::Source GetSourceForPromoURL(const GURL& url) {
@@ -296,21 +246,6 @@ bool ShouldShowAccountManagement(const GURL& url) {
return false;
}
-bool IsContinueUrlForWebBasedSigninFlow(const GURL& url) {
- GURL::Replacements replacements;
- replacements.ClearQuery();
- const std::string& locale = g_browser_process->GetApplicationLocale();
- GURL continue_url =
- GURL(base::StringPrintf(kSignInLandingUrlPrefix, locale.c_str()));
- return (
- google_util::IsGoogleDomainUrl(
- url,
- google_util::ALLOW_SUBDOMAIN,
- google_util::DISALLOW_NON_STANDARD_PORTS) &&
- url.ReplaceComponents(replacements).path() ==
- continue_url.ReplaceComponents(replacements).path());
-}
-
void ForceWebBasedSigninFlowForTesting(bool force) {
g_force_web_based_signin_flow = force;
}
« no previous file with comments | « chrome/browser/signin/signin_promo.h ('k') | chrome/browser/signin/signin_tracker_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698