| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |