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

Side by Side Diff: webkit/common/user_agent/user_agent_util_ios.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/common/user_agent/user_agent_util.h" 5 #include "webkit/common/user_agent/user_agent_util.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include <sys/sysctl.h> 9 #include <sys/sysctl.h>
10 #include <string> 10 #include <string>
11 11
12 #include "base/memory/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/strings/sys_string_conversions.h" 15 #include "base/strings/sys_string_conversions.h"
16 #include "base/sys_info.h" 16 #include "base/sys_info.h"
17 17
18 namespace { 18 namespace {
19 19
20 struct UAVersions { 20 struct UAVersions {
21 const char* safari_version_string; 21 const char* safari_version_string;
22 const char* webkit_version_string; 22 const char* webkit_version_string;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Up until iOS 5, the locale was included at the end of the Safari UA. 103 // Up until iOS 5, the locale was included at the end of the Safari UA.
104 // TODO(stuartmorgan): Remove this once iOS 4.3 is no longer supported. 104 // TODO(stuartmorgan): Remove this once iOS 4.3 is no longer supported.
105 if (os_major_version < 5) { 105 if (os_major_version < 5) {
106 // The locale string is not easy to set correctly. Safari uses a language 106 // The locale string is not easy to set correctly. Safari uses a language
107 // code and a dialect code. However, there is no setting allowing the user 107 // code and a dialect code. However, there is no setting allowing the user
108 // to set the dialect code, and no API to retrieve it. 108 // to set the dialect code, and no API to retrieve it.
109 // Note: The NSLocale methods (currentIdentifier:, 109 // Note: The NSLocale methods (currentIdentifier:,
110 // objectForKey:NSLocaleLanguageCode and objectForKey:NSLocaleCountryCode) 110 // objectForKey:NSLocaleLanguageCode and objectForKey:NSLocaleCountryCode)
111 // are not useful here because they return information related to the 111 // are not useful here because they return information related to the
112 // "Region Format" setting, which is different from the "Language" setting. 112 // "Region Format" setting, which is different from the "Language" setting.
113 scoped_nsobject<NSDictionary> dialects([[NSDictionary alloc] 113 base::scoped_nsobject<NSDictionary> dialects([[NSDictionary alloc]
114 initWithObjectsAndKeys: 114 initWithObjectsAndKeys:
Nico 2013/06/25 01:09:50 Also PR16435 and PR16436
115 @"ar", @"ar", // No dialect code in Safari. 115 @"ar", @"ar", // No dialect code in Safari.
116 @"ca-es", @"ca", 116 @"ca-es", @"ca",
117 @"cs-cz", @"cs", 117 @"cs-cz", @"cs",
118 @"da-dk", @"da", 118 @"da-dk", @"da",
119 @"el-gr", @"el", 119 @"el-gr", @"el",
120 @"en-gb", @"en-GB", 120 @"en-gb", @"en-GB",
121 @"en-us", @"en", 121 @"en-us", @"en",
122 @"he-il", @"he", 122 @"he-il", @"he",
123 @"id", @"id", // No dialect code in Safari. 123 @"id", @"id", // No dialect code in Safari.
124 @"ja-jp", @"ja", 124 @"ja-jp", @"ja",
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 webkit_glue::BuildOSCpuInfo().c_str(), 170 webkit_glue::BuildOSCpuInfo().c_str(),
171 ua_versions.webkit_version_string, 171 ua_versions.webkit_version_string,
172 product.c_str(), 172 product.c_str(),
173 kernel_version, 173 kernel_version,
174 ua_versions.safari_version_string); 174 ua_versions.safari_version_string);
175 175
176 return user_agent; 176 return user_agent;
177 } 177 }
178 178
179 } // namespace webkit_glue 179 } // namespace webkit_glue
OLDNEW
« ui/message_center/cocoa/tray_controller.mm ('K') | « webkit/common/cursors/webcursor_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698