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

Unified Diff: components/signin/core/browser/dice_header_helper.cc

Issue 2923733003: [signin] Add DICe flow for account consistency requests. (Closed)
Patch Set: fix style 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 side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/dice_header_helper.cc
diff --git a/components/signin/core/browser/dice_header_helper.cc b/components/signin/core/browser/dice_header_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3771dcf75bff770b0d2adc759e05dbc2bde843e3
--- /dev/null
+++ b/components/signin/core/browser/dice_header_helper.cc
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/signin/core/browser/dice_header_helper.h"
+
+#include "components/signin/core/common/profile_management_switches.h"
+#include "google_apis/gaia/gaia_auth_util.h"
+#include "google_apis/gaia/gaia_urls.h"
+#include "url/gurl.h"
+
+namespace signin {
+
+bool DiceHeaderHelper::IsUrlEligibleForRequestHeader(const GURL& url) {
+ if (switches::GetAccountConsistencyMethod() !=
+ switches::AccountConsistencyMethod::kDice) {
+ return false;
+ }
+ return gaia::IsGaiaSignonRealm(url.GetOrigin());
+}
+
+std::string DiceHeaderHelper::BuildRequestHeader(bool is_header_request,
+ const GURL& url,
+ const std::string& account_id,
+ int profile_mode_mask) {
+ return "client_id=" + GaiaUrls::GetInstance()->oauth2_chrome_client_id();
+}
+
+} // namespace signin
« no previous file with comments | « components/signin/core/browser/dice_header_helper.h ('k') | components/signin/core/browser/signin_header_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698