OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/html_utils.h" | 5 #include "chrome_frame/html_utils.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <urlmon.h> | 8 #include <urlmon.h> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/string_tokenizer.h" | 11 #include "base/string_tokenizer.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 if (!g_chrome_user_agent[0]) { | 378 if (!g_chrome_user_agent[0]) { |
379 _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); | 379 _pAtlModule->m_csStaticDataInitAndTypeInfo.Lock(); |
380 if (!g_chrome_user_agent[0]) { | 380 if (!g_chrome_user_agent[0]) { |
381 std::string ua; | 381 std::string ua; |
382 | 382 |
383 chrome::VersionInfo version_info; | 383 chrome::VersionInfo version_info; |
384 std::string product("Chrome/"); | 384 std::string product("Chrome/"); |
385 product += version_info.is_valid() ? version_info.Version() | 385 product += version_info.is_valid() ? version_info.Version() |
386 : "0.0.0.0"; | 386 : "0.0.0.0"; |
387 | 387 |
388 ua = webkit_glue::BuildUserAgentFromProduct(product); | 388 ua = webkit_glue::BuildUserAgentHelper(false, product); |
389 | 389 |
390 DCHECK(ua.length() < arraysize(g_chrome_user_agent)); | 390 DCHECK(ua.length() < arraysize(g_chrome_user_agent)); |
391 lstrcpynA(g_chrome_user_agent, ua.c_str(), | 391 lstrcpynA(g_chrome_user_agent, ua.c_str(), |
392 arraysize(g_chrome_user_agent) - 1); | 392 arraysize(g_chrome_user_agent) - 1); |
393 } | 393 } |
394 _pAtlModule->m_csStaticDataInitAndTypeInfo.Unlock(); | 394 _pAtlModule->m_csStaticDataInitAndTypeInfo.Unlock(); |
395 } | 395 } |
396 return g_chrome_user_agent; | 396 return g_chrome_user_agent; |
397 } | 397 } |
398 | 398 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 const std::string& headers) { | 437 const std::string& headers) { |
438 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\r\n"); | 438 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\r\n"); |
439 while (it.GetNext()) { | 439 while (it.GetNext()) { |
440 if (!lstrcmpiA(it.name().c_str(), header.c_str())) | 440 if (!lstrcmpiA(it.name().c_str(), header.c_str())) |
441 return std::string(it.values_begin(), it.values_end()); | 441 return std::string(it.values_begin(), it.values_end()); |
442 } | 442 } |
443 return std::string(); | 443 return std::string(); |
444 } | 444 } |
445 | 445 |
446 } // namespace http_utils | 446 } // namespace http_utils |
OLD | NEW |