OLD | NEW |
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 #include "components/signin/core/browser/signin_header_helper.h" | 5 #include "components/signin/core/browser/signin_header_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 | 209 |
210 ManageAccountsParams BuildManageAccountsParamsIfExists(net::URLRequest* request, | 210 ManageAccountsParams BuildManageAccountsParamsIfExists(net::URLRequest* request, |
211 bool is_off_the_record) { | 211 bool is_off_the_record) { |
212 ManageAccountsParams empty_params; | 212 ManageAccountsParams empty_params; |
213 empty_params.service_type = GAIA_SERVICE_TYPE_NONE; | 213 empty_params.service_type = GAIA_SERVICE_TYPE_NONE; |
214 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) | 214 if (!gaia::IsGaiaSignonRealm(request->url().GetOrigin())) |
215 return empty_params; | 215 return empty_params; |
216 | 216 |
217 std::string header_value; | 217 std::string header_value; |
218 if (!request->response_headers()->GetNormalizedHeader( | 218 net::HttpResponseHeaders* response_headers = request->response_headers(); |
| 219 if (!response_headers || |
| 220 !response_headers->GetNormalizedHeader( |
219 kChromeManageAccountsHeader, &header_value)) { | 221 kChromeManageAccountsHeader, &header_value)) { |
220 return empty_params; | 222 return empty_params; |
221 } | 223 } |
222 | 224 |
223 DCHECK(switches::IsEnableAccountConsistency() && !is_off_the_record); | 225 DCHECK(switches::IsEnableAccountConsistency() && !is_off_the_record); |
224 return BuildManageAccountsParams(header_value); | 226 return BuildManageAccountsParams(header_value); |
225 } | 227 } |
226 | 228 |
227 } // namespace signin | 229 } // namespace signin |
OLD | NEW |