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

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

Issue 293983019: Add enable_account_consistency attr to x-chrome-connected header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/signin/signin_header_helper.cc
diff --git a/chrome/browser/signin/signin_header_helper.cc b/chrome/browser/signin/signin_header_helper.cc
index 063698a842a05ef7abc44f445408b0e54cc4edbb..96f1a65360e9e987ef480a20e8a5cd0943920e39 100644
--- a/chrome/browser/signin/signin_header_helper.cc
+++ b/chrome/browser/signin/signin_header_helper.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/signin/signin_header_helper.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/stringprintf.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile_io_data.h"
@@ -30,6 +31,9 @@ namespace {
const char kChromeConnectedHeader[] = "X-Chrome-Connected";
const char kChromeManageAccountsHeader[] = "X-Chrome-Manage-Accounts";
const char kGaiaSignoutOptionsIncognito[] = "SIGNOUTOPTIONS_INCOGNITO";
+const char kGaiaIdAttrName[] = "id";
+const char kProfileModeAttrName[] = "mode";
+const char kEnableAccountConsistencyAttrName[] = "enable_account_consistency";
// Processes the mirror response header on the UI thread. Currently depending
// on the value of |header_value|, it either shows the profile avatar menu, or
@@ -100,9 +104,10 @@ void AppendMirrorRequestHeaderIfPossible(
// available.
const GURL& url = redirect_url.is_empty() ? request->url() : redirect_url;
GURL origin(url.GetOrigin());
+ bool is_new_profile_management = switches::IsNewProfileManagement();
bool is_google_url =
!switches::IsEnableWebBasedSignin() &&
- switches::IsNewProfileManagement() &&
+ is_new_profile_management &&
google_util::IsGoogleDomainUrl(
url,
google_util::ALLOW_SUBDOMAIN,
@@ -119,8 +124,12 @@ void AppendMirrorRequestHeaderIfPossible(
profile_mode_mask |= PROFILE_MODE_INCOGNITO_DISABLED;
}
- std::string header_value =
- account_id + ":" + base::IntToString(profile_mode_mask);
+ // TODO(guohui): needs to make a new flag for enabling account consistency.
+ std::string header_value(base::StringPrintf("%s=%s,%s=%s,%s=%s",
+ kGaiaIdAttrName, account_id.c_str(),
+ kProfileModeAttrName, base::IntToString(profile_mode_mask).c_str(),
+ kEnableAccountConsistencyAttrName,
+ is_new_profile_management ? "true" : "false"));
request->SetExtraRequestHeaderByName(
kChromeConnectedHeader, header_value, false);
}
« 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