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

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

Issue 579033002: [Clean-up] Remove some dead code for handling Webstore sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore incorrectly deleted code Created 6 years, 3 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_promo_unittest.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 149fa6f1e614015df9fcf1b60cdf72f682edaa19..55a85781b9e32b00c050f7871cd45657a51da487 100644
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -37,7 +37,6 @@
#include "url/gurl.h"
using content::WebContents;
-using net::GetValueForKeyInQuery;
namespace {
@@ -177,13 +176,6 @@ GURL GetPromoURL(Source source, bool auto_close) {
}
GURL GetPromoURL(Source source, bool auto_close, bool is_constrained) {
- return GetPromoURLWithContinueURL(source, auto_close, is_constrained, GURL());
-}
-
-GURL GetPromoURLWithContinueURL(Source source,
- bool auto_close,
- bool is_constrained,
- GURL continue_url) {
DCHECK_NE(SOURCE_UNKNOWN, source);
if (!switches::IsEnableWebBasedSignin()) {
@@ -193,15 +185,6 @@ GURL GetPromoURLWithContinueURL(Source source,
base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyAutoClose);
if (is_constrained)
base::StringAppendF(&url, "&%s=1", kSignInPromoQueryKeyConstrained);
- if (!continue_url.is_empty()) {
- DCHECK(continue_url.is_valid());
- std::string escaped_continue_url =
- net::EscapeQueryParamValue(continue_url.spec(), false);
- base::StringAppendF(&url,
- "&%s=%s",
- kSignInPromoQueryKeyContinue,
- escaped_continue_url.c_str());
- }
return GURL(url);
}
@@ -221,19 +204,16 @@ GURL GetPromoURLWithContinueURL(Source source,
// See OneClickSigninHelper for details.
std::string query_string = "?service=chromiumsync&sarp=1";
- DCHECK(continue_url.is_empty());
- std::string continue_url_str = GetLandingURL(kSignInPromoQueryKeySource,
- static_cast<int>(source)).spec();
- if (auto_close) {
- base::StringAppendF(
- &continue_url_str, "&%s=1", kSignInPromoQueryKeyAutoClose);
- }
+ std::string continue_url = GetLandingURL(kSignInPromoQueryKeySource,
+ static_cast<int>(source)).spec();
+ if (auto_close)
+ base::StringAppendF(&continue_url, "&%s=1", kSignInPromoQueryKeyAutoClose);
base::StringAppendF(
&query_string,
"&%s=%s",
kSignInPromoQueryKeyContinue,
- net::EscapeQueryParamValue(continue_url_str, false).c_str());
+ net::EscapeQueryParamValue(continue_url, false).c_str());
return GaiaUrls::GetInstance()->service_login_url().Resolve(query_string);
}
@@ -259,7 +239,7 @@ GURL GetReauthURL(Profile* profile, const std::string& account_id) {
GURL GetNextPageURLForPromoURL(const GURL& url) {
std::string value;
- if (GetValueForKeyInQuery(url, kSignInPromoQueryKeyContinue, &value)) {
+ if (net::GetValueForKeyInQuery(url, kSignInPromoQueryKeyContinue, &value)) {
GURL continue_url = GURL(value);
if (continue_url.is_valid())
return continue_url;
@@ -270,7 +250,7 @@ GURL GetNextPageURLForPromoURL(const GURL& url) {
Source GetSourceForPromoURL(const GURL& url) {
std::string value;
- if (GetValueForKeyInQuery(url, kSignInPromoQueryKeySource, &value)) {
+ if (net::GetValueForKeyInQuery(url, kSignInPromoQueryKeySource, &value)) {
int source = 0;
if (base::StringToInt(value, &source) && source >= SOURCE_START_PAGE &&
source < SOURCE_UNKNOWN) {
@@ -282,7 +262,7 @@ Source GetSourceForPromoURL(const GURL& url) {
bool IsAutoCloseEnabledInURL(const GURL& url) {
std::string value;
- if (GetValueForKeyInQuery(url, kSignInPromoQueryKeyAutoClose, &value)) {
+ if (net::GetValueForKeyInQuery(url, kSignInPromoQueryKeyAutoClose, &value)) {
int enabled = 0;
if (base::StringToInt(value, &enabled) && enabled == 1)
return true;
@@ -292,7 +272,7 @@ bool IsAutoCloseEnabledInURL(const GURL& url) {
bool ShouldShowAccountManagement(const GURL& url) {
std::string value;
- if (GetValueForKeyInQuery(
+ if (net::GetValueForKeyInQuery(
url, kSignInPromoQueryKeyShowAccountManagement, &value)) {
int enabled = 0;
if (base::StringToInt(value, &enabled) && enabled == 1)
« no previous file with comments | « chrome/browser/signin/signin_promo.h ('k') | chrome/browser/signin/signin_promo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698