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

Unified Diff: components/signin/core/browser/chrome_connected_header_helper.h

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 side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/chrome_connected_header_helper.h
diff --git a/components/signin/core/browser/chrome_connected_header_helper.h b/components/signin/core/browser/chrome_connected_header_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..0fbe26dada12cbf92ced4ab8496f2b4c043d606d
--- /dev/null
+++ b/components/signin/core/browser/chrome_connected_header_helper.h
@@ -0,0 +1,46 @@
+// 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.
+
+#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_
+#define COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_
+
+#include <string>
+
+#include "components/signin/core/browser/signin_header_helper.h"
+
+class GURL;
+
+namespace signin {
+
+extern const char kChromeConnectedHeader[];
+
+// SigninHeaderHelper implementation managing the "X-Chrome-Connected" header.
+class ChromeConnectedHeaderHelper : public SigninHeaderHelper {
msarda 2017/06/08 23:43:04 I think in general we add the constructor and the
droger 2017/06/09 09:52:24 Done.
+ public:
+ // Returns the CHROME_CONNECTED cookie, or an empty string if it should not be
+ // added to the request to |url|.
+ static std::string BuildRequestCookieIfPossible(
+ const GURL& url,
+ const std::string& account_id,
+ const content_settings::CookieSettings* cookie_settings,
+ int profile_mode_mask);
+
+ private:
+ // Returns whether the URL is eligible for the GaiaID parameter.
msarda 2017/06/08 23:43:04 s/GaiaID/Gaia ID
droger 2017/06/09 09:52:24 Done.
+ bool IsUrlEligibleToIncludeGaiaId(const GURL& url, bool is_header_request);
+
+ // Returns whether the URL has a Google Drive origin.
+ bool IsDriveOrigin(const GURL& url);
+
+ // SigninHeaderHelper implementation:
+ bool IsUrlEligibleForRequestHeader(const GURL& url) override;
+ std::string BuildRequestHeader(bool is_header_request,
+ const GURL& url,
+ const std::string& account_id,
+ int profile_mode_mask) override;
+};
+
+} // namespace signin
+
+#endif // COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698