| OLD | NEW |
| 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 "base/ios/ios_util.h" | 5 #include "base/ios/ios_util.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return digits; | 21 return digits; |
| 22 } | 22 } |
| 23 | 23 |
| 24 std::string* g_icudtl_path_override = nullptr; | 24 std::string* g_icudtl_path_override = nullptr; |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace base { | 28 namespace base { |
| 29 namespace ios { | 29 namespace ios { |
| 30 | 30 |
| 31 bool IsRunningOnIOS9OrLater() { | |
| 32 return IsRunningOnOrLater(9, 0, 0); | |
| 33 } | |
| 34 | |
| 35 bool IsRunningOnIOS10OrLater() { | 31 bool IsRunningOnIOS10OrLater() { |
| 36 return IsRunningOnOrLater(10, 0, 0); | 32 return IsRunningOnOrLater(10, 0, 0); |
| 37 } | 33 } |
| 38 | 34 |
| 39 bool IsRunningOnOrLater(int32_t major, int32_t minor, int32_t bug_fix) { | 35 bool IsRunningOnOrLater(int32_t major, int32_t minor, int32_t bug_fix) { |
| 40 static const int32_t* current_version = OSVersionAsArray(); | 36 static const int32_t* current_version = OSVersionAsArray(); |
| 41 int32_t version[] = {major, minor, bug_fix}; | 37 int32_t version[] = {major, minor, bug_fix}; |
| 42 for (size_t i = 0; i < arraysize(version); i++) { | 38 for (size_t i = 0; i < arraysize(version); i++) { |
| 43 if (current_version[i] != version[i]) | 39 if (current_version[i] != version[i]) |
| 44 return current_version[i] > version[i]; | 40 return current_version[i] > version[i]; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 | 54 |
| 59 FilePath FilePathOfEmbeddedICU() { | 55 FilePath FilePathOfEmbeddedICU() { |
| 60 if (g_icudtl_path_override) { | 56 if (g_icudtl_path_override) { |
| 61 return FilePath(*g_icudtl_path_override); | 57 return FilePath(*g_icudtl_path_override); |
| 62 } | 58 } |
| 63 return FilePath(); | 59 return FilePath(); |
| 64 } | 60 } |
| 65 | 61 |
| 66 } // namespace ios | 62 } // namespace ios |
| 67 } // namespace base | 63 } // namespace base |
| OLD | NEW |