OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome_frame/http_negotiate.h" | 5 #include "chrome_frame/http_negotiate.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlcom.h> | 8 #include <atlcom.h> |
9 #include <htiframe.h> | 9 #include <htiframe.h> |
10 | 10 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Replace the user-agent header with Chrome's. | 236 // Replace the user-agent header with Chrome's. |
237 updated_headers = ReplaceOrAddUserAgent(*additional_headers, | 237 updated_headers = ReplaceOrAddUserAgent(*additional_headers, |
238 http_utils::GetChromeUserAgent()); | 238 http_utils::GetChromeUserAgent()); |
239 } else { | 239 } else { |
240 updated_headers = AppendCFUserAgentString(headers, *additional_headers); | 240 updated_headers = AppendCFUserAgentString(headers, *additional_headers); |
241 } | 241 } |
242 *additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemRealloc( | 242 *additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemRealloc( |
243 *additional_headers, | 243 *additional_headers, |
244 (updated_headers.length() + 1) * sizeof(wchar_t))); | 244 (updated_headers.length() + 1) * sizeof(wchar_t))); |
245 lstrcpyW(*additional_headers, ASCIIToWide(updated_headers).c_str()); | 245 lstrcpyW(*additional_headers, ASCIIToWide(updated_headers).c_str()); |
| 246 } else { |
| 247 // TODO(erikwright): Remove the user agent if it is present (i.e., because |
| 248 // of PostPlatform setting in the registry). |
246 } | 249 } |
247 return S_OK; | 250 return S_OK; |
248 } | 251 } |
OLD | NEW |