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

Side by Side Diff: content/common/user_agent.cc

Issue 394233003: Ozone builds get identified as unknown in user agent string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/public/common/user_agent.h" 5 #include "content/public/common/user_agent.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 return os_cpu; 156 return os_cpu;
157 } 157 }
158 158
159 std::string BuildUserAgentFromProduct(const std::string& product) { 159 std::string BuildUserAgentFromProduct(const std::string& product) {
160 const char kUserAgentPlatform[] = 160 const char kUserAgentPlatform[] =
161 #if defined(OS_WIN) 161 #if defined(OS_WIN)
162 ""; 162 "";
163 #elif defined(OS_MACOSX) 163 #elif defined(OS_MACOSX)
164 "Macintosh; "; 164 "Macintosh; ";
165 #elif defined(USE_X11) 165 #elif defined(USE_X11) || defined(USE_OZONE)
166 "X11; "; // strange, but that's what Firefox uses 166 "X11; "; // strange, but that's what Firefox uses
167 #elif defined(OS_ANDROID) 167 #elif defined(OS_ANDROID)
168 "Linux; "; 168 "Linux; ";
169 #else 169 #else
170 "Unknown; "; 170 "Unknown; ";
171 #endif 171 #endif
172 172
173 std::string os_info; 173 std::string os_info;
174 base::StringAppendF( 174 base::StringAppendF(
175 &os_info, "%s%s", kUserAgentPlatform, BuildOSCpuInfo().c_str()); 175 &os_info, "%s%s", kUserAgentPlatform, BuildOSCpuInfo().c_str());
(...skipping 12 matching lines...) Expand all
188 os_info.c_str(), 188 os_info.c_str(),
189 WEBKIT_VERSION_MAJOR, 189 WEBKIT_VERSION_MAJOR,
190 WEBKIT_VERSION_MINOR, 190 WEBKIT_VERSION_MINOR,
191 product.c_str(), 191 product.c_str(),
192 WEBKIT_VERSION_MAJOR, 192 WEBKIT_VERSION_MAJOR,
193 WEBKIT_VERSION_MINOR); 193 WEBKIT_VERSION_MINOR);
194 return user_agent; 194 return user_agent;
195 } 195 }
196 196
197 } // namespace content 197 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698