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

Side by Side Diff: components/signin/core/browser/signin_header_helper.h

Issue 2925083002: [signin] Move Mirror code to ChromeConnectedHeaderHelper (Closed)
Patch Set: 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SIGNIN_HEADER_HELPER_H_ 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_ 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_
7 7
8 #include <map>
8 #include <string> 9 #include <string>
9 10
10 #include "build/build_config.h" // For OS_IOS
11
12 namespace content_settings { 11 namespace content_settings {
13 class CookieSettings; 12 class CookieSettings;
14 } 13 }
15 14
16 namespace net { 15 namespace net {
17 class URLRequest; 16 class URLRequest;
18 } 17 }
19 18
20 class GURL; 19 class GURL;
21 20
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const char* header_name, 80 const char* header_name,
82 const GURL& redirect_url, 81 const GURL& redirect_url,
83 const std::string& account_id, 82 const std::string& account_id,
84 const content_settings::CookieSettings* cookie_settings, 83 const content_settings::CookieSettings* cookie_settings,
85 int profile_mode_mask); 84 int profile_mode_mask);
86 85
87 protected: 86 protected:
88 SigninHeaderHelper() {} 87 SigninHeaderHelper() {}
89 virtual ~SigninHeaderHelper() {} 88 virtual ~SigninHeaderHelper() {}
90 89
90 // Dictionary of fields in a account consistency response header.
91 using ResponseHeaderDictionary = std::map<std::string, std::string>;
92
93 // Parses the account consistency response header. Its expected format is
94 // "key1=value1,key2=value2,...".
95 static ResponseHeaderDictionary ParseAccountConsistencyResponseHeader(
96 const std::string& header_value);
97
91 // Returns the value of the request header, or empty if the header should not 98 // Returns the value of the request header, or empty if the header should not
92 // be added. Calls into BuildRequestHeader() which is customized by 99 // be added. Calls into BuildRequestHeader() which is customized by
93 // subclasses. 100 // subclasses.
94 std::string BuildRequestHeaderIfPossible( 101 std::string BuildRequestHeaderIfPossible(
95 bool is_header_request, 102 bool is_header_request,
96 const GURL& url, 103 const GURL& url,
97 const std::string& account_id, 104 const std::string& account_id,
98 const content_settings::CookieSettings* cookie_settings, 105 const content_settings::CookieSettings* cookie_settings,
99 int profile_mode_mask); 106 int profile_mode_mask);
100 107
(...skipping 29 matching lines...) Expand all
130 net::URLRequest* request, 137 net::URLRequest* request,
131 const GURL& redirect_url, 138 const GURL& redirect_url,
132 const std::string& account_id, 139 const std::string& account_id,
133 const content_settings::CookieSettings* cookie_settings, 140 const content_settings::CookieSettings* cookie_settings,
134 int profile_mode_mask); 141 int profile_mode_mask);
135 142
136 // Returns the parameters contained in the X-Chrome-Manage-Accounts response 143 // Returns the parameters contained in the X-Chrome-Manage-Accounts response
137 // header. 144 // header.
138 ManageAccountsParams BuildManageAccountsParams(const std::string& header_value); 145 ManageAccountsParams BuildManageAccountsParams(const std::string& header_value);
139 146
140 // Returns the parameters contained in the X-Chrome-Manage-Accounts response
141 // header.
142 // If the request does not have a response header or if the header contains
143 // garbage, then |service_type| is set to |GAIA_SERVICE_TYPE_NONE|.
144 ManageAccountsParams BuildManageAccountsParamsIfExists(net::URLRequest* request,
145 bool is_off_the_record);
146
147 } // namespace signin 147 } // namespace signin
148 148
149 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_ 149 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698