| 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 "ios/web/public/user_agent.h" | 5 #include "ios/web/public/user_agent.h" |
| 6 | 6 |
| 7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 #include <sys/sysctl.h> | 11 #include <sys/sysctl.h> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/mac/scoped_nsobject.h" | 14 #include "base/mac/scoped_nsobject.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 18 #include "base/strings/sys_string_conversions.h" | 18 #include "base/strings/sys_string_conversions.h" |
| 19 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
| 20 | 20 |
| 21 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 22 #error "This file requires ARC support." |
| 23 #endif |
| 24 |
| 21 namespace { | 25 namespace { |
| 22 | 26 |
| 23 struct UAVersions { | 27 struct UAVersions { |
| 24 const char* safari_version_string; | 28 const char* safari_version_string; |
| 25 const char* webkit_version_string; | 29 const char* webkit_version_string; |
| 26 }; | 30 }; |
| 27 | 31 |
| 28 struct OSVersionMap { | 32 struct OSVersionMap { |
| 29 int32_t major_os_version; | 33 int32_t major_os_version; |
| 30 int32_t minor_os_version; | 34 int32_t minor_os_version; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 BuildOSCpuInfo().c_str(), | 129 BuildOSCpuInfo().c_str(), |
| 126 ua_versions.webkit_version_string, | 130 ua_versions.webkit_version_string, |
| 127 product.c_str(), | 131 product.c_str(), |
| 128 kernel_version, | 132 kernel_version, |
| 129 ua_versions.safari_version_string); | 133 ua_versions.safari_version_string); |
| 130 | 134 |
| 131 return user_agent; | 135 return user_agent; |
| 132 } | 136 } |
| 133 | 137 |
| 134 } // namespace web | 138 } // namespace web |
| OLD | NEW |