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

Unified Diff: base/ios/device_util.mm

Issue 11031066: Adding utility method to test the version of the OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix namespace Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« base/ios/OWNERS ('K') | « base/ios/OWNERS ('k') | base/sys_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/ios/device_util.mm
diff --git a/base/ios/device_util.mm b/base/ios/device_util.mm
index 1d16de4b9b878c3890a64dfcd1fee552e789d9ac..8e57d752f9096969ec332a4dcb3470840a257515 100644
--- a/base/ios/device_util.mm
+++ b/base/ios/device_util.mm
@@ -6,6 +6,7 @@
#include <CommonCrypto/CommonDigest.h>
#import <Foundation/Foundation.h>
stuartmorgan 2012/10/05 12:19:43 I believe UIKit includes Foundation, so this can p
qsr 2012/10/05 14:53:55 Done.
+#import <UIKit/UIKit.h>
#include <ifaddrs.h>
#include <net/if_dl.h>
@@ -16,6 +17,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
+#include "base/sys_info.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/scoped_ptr.h"
#include "base/sys_string_conversions.h"
@@ -103,7 +105,10 @@ std::string GetDeviceIdentifier(const char* salt) {
NSString* client_id = [defaults stringForKey:kClientIdPreferenceKey];
if (!client_id) {
- client_id = base::SysUTF8ToNSString(GetRandomId());
+ if (base::SysInfo::IsRunningOnIOS6OrLater())
+ client_id = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
+ else
+ client_id = base::SysUTF8ToNSString(GetRandomId());
[defaults setObject:client_id forKey:kClientIdPreferenceKey];
[defaults synchronize];
}
« base/ios/OWNERS ('K') | « base/ios/OWNERS ('k') | base/sys_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698