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

Side by Side Diff: ios/web/public/user_agent.mm

Issue 2306563002: Update user agent version for iOS10. (Closed)
Patch Set: Created 4 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
« 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 "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>
(...skipping 14 matching lines...) Expand all
25 const char* webkit_version_string; 25 const char* webkit_version_string;
26 }; 26 };
27 27
28 struct OSVersionMap { 28 struct OSVersionMap {
29 int32_t major_os_version; 29 int32_t major_os_version;
30 int32_t minor_os_version; 30 int32_t minor_os_version;
31 UAVersions ua_versions; 31 UAVersions ua_versions;
32 }; 32 };
33 33
34 const UAVersions& GetUAVersionsForCurrentOS() { 34 const UAVersions& GetUAVersionsForCurrentOS() {
35 // The WebKit version can be extracted dynamically from UIWebView, but the 35 // The WebKit version can be extracted dynamically from UIWebView, but the
justincohen 2016/09/01 11:53:55 eugenebut@ is this comment still true, especially
Eugene But (OOO till 7-30) 2016/09/01 15:56:54 I don't know how WebKit version extraction worked
36 // Safari version can't be, so a lookup table is used instead (for both, since 36 // Safari version can't be, so a lookup table is used instead (for both, since
37 // the reported versions should stay in sync). 37 // the reported versions should stay in sync).
38 static const OSVersionMap version_map[] = { 38 static const OSVersionMap version_map[] = {
39 {10, 0, {"602.1", "602.1.50"}},
39 {9, 0, {"601.1.46", "601.1"}}, 40 {9, 0, {"601.1.46", "601.1"}},
40 {8, 0, {"600.1.4", "600.1.4"}}, 41 {8, 0, {"600.1.4", "600.1.4"}},
41 {7, 1, {"9537.53", "537.51.2"}}, 42 {7, 1, {"9537.53", "537.51.2"}},
42 {7, 0, {"9537.53", "537.51.1"}}, 43 {7, 0, {"9537.53", "537.51.1"}},
43 }; 44 };
44 45
45 int32_t os_major_version = 0; 46 int32_t os_major_version = 0;
46 int32_t os_minor_version = 0; 47 int32_t os_minor_version = 0;
47 int32_t os_bugfix_version = 0; 48 int32_t os_bugfix_version = 0;
48 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, 49 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 BuildOSCpuInfo().c_str(), 125 BuildOSCpuInfo().c_str(),
125 ua_versions.webkit_version_string, 126 ua_versions.webkit_version_string,
126 product.c_str(), 127 product.c_str(),
127 kernel_version, 128 kernel_version,
128 ua_versions.safari_version_string); 129 ua_versions.safari_version_string);
129 130
130 return user_agent; 131 return user_agent;
131 } 132 }
132 133
133 } // namespace web 134 } // namespace web
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