| OLD | NEW | 
|   1 // Copyright 2017 The Chromium Authors. All rights reserved. |   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 |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ |   5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ | 
|   6 #define COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ |   6 #define COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ | 
|   7  |   7  | 
|   8 #include <string> |   8 #include <string> | 
|   9  |   9  | 
|  10 #include "components/signin/core/browser/signin_header_helper.h" |  10 #include "components/signin/core/browser/signin_header_helper.h" | 
|  11  |  11  | 
|  12 class GURL; |  12 class GURL; | 
|  13  |  13  | 
|  14 namespace signin { |  14 namespace signin { | 
|  15  |  15  | 
|  16 // SigninHeaderHelper implementation managing the "X-Chrome-Connected" header. |  16 // SigninHeaderHelper implementation managing the "X-Chrome-Connected" header. | 
|  17 class ChromeConnectedHeaderHelper : public SigninHeaderHelper { |  17 class ChromeConnectedHeaderHelper : public SigninHeaderHelper { | 
|  18  public: |  18  public: | 
|  19   ChromeConnectedHeaderHelper() {} |  19   ChromeConnectedHeaderHelper() {} | 
|  20   ~ChromeConnectedHeaderHelper() override {} |  20   ~ChromeConnectedHeaderHelper() override {} | 
|  21  |  21  | 
|  22   // Returns the Chrome-Connected cookie, or an empty string if it should not be |  22   // Returns the Chrome-Connected cookie, or an empty string if it should not be | 
|  23   // added to the request to |url|. |  23   // added to the request to |url|. | 
|  24   static std::string BuildRequestCookieIfPossible( |  24   static std::string BuildRequestCookieIfPossible( | 
|  25       const GURL& url, |  25       const GURL& url, | 
|  26       const std::string& account_id, |  26       const std::string& account_id, | 
|  27       const content_settings::CookieSettings* cookie_settings, |  27       const content_settings::CookieSettings* cookie_settings, | 
|  28       int profile_mode_mask); |  28       int profile_mode_mask); | 
|  29  |  29  | 
 |  30   // Returns the parameters contained in the X-Chrome-Manage-Accounts response | 
 |  31   // header. | 
 |  32   static ManageAccountsParams BuildManageAccountsParams( | 
 |  33       const std::string& header_value); | 
 |  34  | 
|  30  private: |  35  private: | 
|  31   // Returns whether the URL is eligible for the Gaia ID parameter. |  36   // Returns whether the URL is eligible for the Gaia ID parameter. | 
|  32   bool IsUrlEligibleToIncludeGaiaId(const GURL& url, bool is_header_request); |  37   bool IsUrlEligibleToIncludeGaiaId(const GURL& url, bool is_header_request); | 
|  33  |  38  | 
|  34   // Returns whether the URL has a Google Drive origin. |  39   // Returns whether the URL has a Google Drive origin. | 
|  35   bool IsDriveOrigin(const GURL& url); |  40   bool IsDriveOrigin(const GURL& url); | 
|  36  |  41  | 
|  37   // SigninHeaderHelper implementation: |  42   // SigninHeaderHelper implementation: | 
|  38   bool IsUrlEligibleForRequestHeader(const GURL& url) override; |  43   bool IsUrlEligibleForRequestHeader(const GURL& url) override; | 
|  39   std::string BuildRequestHeader(bool is_header_request, |  44   std::string BuildRequestHeader(bool is_header_request, | 
|  40                                  const GURL& url, |  45                                  const GURL& url, | 
|  41                                  const std::string& account_id, |  46                                  const std::string& account_id, | 
|  42                                  int profile_mode_mask) override; |  47                                  int profile_mode_mask) override; | 
|  43 }; |  48 }; | 
|  44  |  49  | 
|  45 }  // namespace signin |  50 }  // namespace signin | 
|  46  |  51  | 
|  47 #endif  // COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ |  52 #endif  // COMPONENTS_SIGNIN_CORE_BROWSER_CHROME_CONNECTED_HEADER_HELPER_H_ | 
| OLD | NEW |