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

Side by Side Diff: webkit/glue/user_agent.cc

Issue 4974001: base: Get rid of 'using' declaration of StringAppendF. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 10 years, 1 month 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
« no previous file with comments | « webkit/glue/plugins/plugin_list_posix.cc ('k') | webkit/glue/webkit_glue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "webkit/glue/user_agent.h" 5 #include "webkit/glue/user_agent.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) 7 #if defined(OS_POSIX) && !defined(OS_MACOSX)
8 #include <sys/utsname.h> 8 #include <sys/utsname.h>
9 #endif 9 #endif
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 std::string cputype; 45 std::string cputype;
46 // special case for biarch systems 46 // special case for biarch systems
47 if (strcmp(unixinfo.machine, "x86_64") == 0 && 47 if (strcmp(unixinfo.machine, "x86_64") == 0 &&
48 sizeof(void*) == sizeof(int32)) { // NOLINT 48 sizeof(void*) == sizeof(int32)) { // NOLINT
49 cputype.assign("i686 (x86_64)"); 49 cputype.assign("i686 (x86_64)");
50 } else { 50 } else {
51 cputype.assign(unixinfo.machine); 51 cputype.assign(unixinfo.machine);
52 } 52 }
53 #endif 53 #endif
54 54
55 StringAppendF( 55 base::StringAppendF(
56 &os_cpu, 56 &os_cpu,
57 #if defined(OS_WIN) 57 #if defined(OS_WIN)
58 "Windows NT %d.%d", 58 "Windows NT %d.%d",
59 os_major_version, 59 os_major_version,
60 os_minor_version 60 os_minor_version
61 #elif defined(OS_MACOSX) 61 #elif defined(OS_MACOSX)
62 "Intel Mac OS X %d_%d_%d", 62 "Intel Mac OS X %d_%d_%d",
63 os_major_version, 63 os_major_version,
64 os_minor_version, 64 os_minor_version,
65 os_bugfix_version 65 os_bugfix_version
(...skipping 29 matching lines...) Expand all
95 95
96 // TODO(port): figure out correct locale 96 // TODO(port): figure out correct locale
97 const char kUserAgentLocale[] = "en-US"; 97 const char kUserAgentLocale[] = "en-US";
98 98
99 // Get the product name and version, and replace Safari's Version/X string 99 // Get the product name and version, and replace Safari's Version/X string
100 // with it. This is done to expose our product name in a manner that is 100 // with it. This is done to expose our product name in a manner that is
101 // maximally compatible with Safari, we hope!! 101 // maximally compatible with Safari, we hope!!
102 std::string product = GetProductVersion(); 102 std::string product = GetProductVersion();
103 103
104 // Derived from Safari's UA string. 104 // Derived from Safari's UA string.
105 StringAppendF( 105 base::StringAppendF(
106 result, 106 result,
107 "Mozilla/5.0 (%s; %c; %s; %s) AppleWebKit/%d.%d" 107 "Mozilla/5.0 (%s; %c; %s; %s) AppleWebKit/%d.%d"
108 " (KHTML, like Gecko) %s Safari/%d.%d", 108 " (KHTML, like Gecko) %s Safari/%d.%d",
109 mimic_windows ? "Windows" : kUserAgentPlatform, 109 mimic_windows ? "Windows" : kUserAgentPlatform,
110 kUserAgentSecurity, 110 kUserAgentSecurity,
111 ((mimic_windows ? "Windows " : "") + BuildOSCpuInfo()).c_str(), 111 ((mimic_windows ? "Windows " : "") + BuildOSCpuInfo()).c_str(),
112 kUserAgentLocale, 112 kUserAgentLocale,
113 WEBKIT_VERSION_MAJOR, 113 WEBKIT_VERSION_MAJOR,
114 WEBKIT_VERSION_MINOR, 114 WEBKIT_VERSION_MINOR,
115 product.c_str(), 115 product.c_str(),
116 WEBKIT_VERSION_MAJOR, 116 WEBKIT_VERSION_MAJOR,
117 WEBKIT_VERSION_MINOR); 117 WEBKIT_VERSION_MINOR);
118 } 118 }
119 119
120 } // namespace webkit_glue 120 } // namespace webkit_glue
121 121
OLDNEW
« no previous file with comments | « webkit/glue/plugins/plugin_list_posix.cc ('k') | webkit/glue/webkit_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698