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

Side by Side Diff: components/signin/core/browser/dice_header_helper.cc

Issue 2923733003: [signin] Add DICe flow for account consistency requests. (Closed)
Patch Set: Add test for Dice disabled Created 3 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/signin/core/browser/dice_header_helper.h"
6
7 #include "components/signin/core/common/profile_management_switches.h"
8 #include "google_apis/gaia/gaia_auth_util.h"
9 #include "google_apis/gaia/gaia_urls.h"
10 #include "url/gurl.h"
11
12 namespace signin {
13
14 extern const char kDiceRequestHeader[] = "X-Chrome-ID-Consistency-Request";
15
16 bool DiceHeaderHelper::IsUrlEligibleForRequestHeader(const GURL& url) {
17 if (switches::GetAccountConsistencyMethod() !=
18 switches::AccountConsistencyMethod::kDice) {
19 return false;
20 }
21 return gaia::IsGaiaSignonRealm(url.GetOrigin());
22 }
23
24 std::string DiceHeaderHelper::BuildRequestHeader(bool is_header_request,
25 const GURL& url,
26 const std::string& account_id,
27 int profile_mode_mask) {
28 return "client_id=" + GaiaUrls::GetInstance()->oauth2_chrome_client_id();
29 }
30
31 } // namespace signin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698