| OLD | NEW |
| (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 bool DiceHeaderHelper::IsUrlEligibleForRequestHeader(const GURL& url) { |
| 15 if (switches::GetAccountConsistencyMethod() != |
| 16 switches::AccountConsistencyMethod::kDice) { |
| 17 return false; |
| 18 } |
| 19 return gaia::IsGaiaSignonRealm(url.GetOrigin()); |
| 20 } |
| 21 |
| 22 std::string DiceHeaderHelper::BuildRequestHeader(bool is_header_request, |
| 23 const GURL& url, |
| 24 const std::string& account_id, |
| 25 int profile_mode_mask) { |
| 26 return "client_id=" + GaiaUrls::GetInstance()->oauth2_chrome_client_id(); |
| 27 } |
| 28 |
| 29 } // namespace signin |
| OLD | NEW |