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

Side by Side Diff: chrome_frame/html_utils.cc

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix GetUserAgent() to return whether the user agent is overriding, clean up Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::BuildUserAgentHelper(false, product); 388 ua = webkit_glue::BuildUserAgentHelper(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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698