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

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

Issue 1220843003: Perform online reauth when password is changed for a locked profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 5 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: chrome/browser/signin/signin_promo.cc
diff --git a/chrome/browser/signin/signin_promo.cc b/chrome/browser/signin/signin_promo.cc
index 0f0c1e0ddaec0b6c4dc0b8b0c76adcfae9c82ca2..9ab3e0ad02774f568c15ebc9e5724f71151c9b70 100644
--- a/chrome/browser/signin/signin_promo.cc
+++ b/chrome/browser/signin/signin_promo.cc
@@ -195,14 +195,22 @@ GURL GetReauthURL(Profile* profile, const std::string& account_id) {
AccountTrackerService::AccountInfo info =
AccountTrackerServiceFactory::GetForProfile(profile)->
GetAccountInfo(account_id);
+ return GetReauthURLWithEmail(std::string::npos, info.email);
+}
+GURL GetReauthURLWithEmail(size_t profile_index, const std::string& email) {
signin_metrics::Source source = switches::IsNewAvatarMenu() ?
signin_metrics::SOURCE_REAUTH : signin_metrics::SOURCE_SETTINGS;
GURL url = signin::GetPromoURL(
source, true /* auto_close */,
switches::IsNewAvatarMenu() /* is_constrained */);
- url = net::AppendQueryParameter(url, "email", info.email);
+
+ if (profile_index != std::string::npos)
Alexei Svitkine (slow) 2015/07/23 21:49:33 Nit: {}'s
Roger Tawa OOO till Jul 10th 2015/07/24 16:15:12 Changes in this file undone.
+ url = net::AppendQueryParameter(url, kSignInPromoQueryKeyProfileIndex,
+ base::SizeTToString(profile_index));
+
+ url = net::AppendQueryParameter(url, "email", email);
url = net::AppendQueryParameter(url, "validateEmail", "1");
return net::AppendQueryParameter(url, "readOnlyEmail", "1");
}
@@ -218,6 +226,18 @@ GURL GetNextPageURLForPromoURL(const GURL& url) {
return GURL();
}
+size_t GetProfileIndexForPromoURL(const GURL& url) {
+ size_t index = std::string::npos;
+ std::string value;
+ if (net::GetValueForKeyInQuery(url, kSignInPromoQueryKeyProfileIndex,
+ &value) &&
+ base::StringToSizeT(value, &index)) {
+ return index;
+ }
+
+ return std::string::npos;
+}
+
GURL GetSigninPartitionURL() {
return GURL("chrome-guest://chrome-signin/?");
}

Powered by Google App Engine
This is Rietveld 408576698