Skip to content

Commit

Permalink
[iOS] Adds a version check function for iOS 7.
Browse files Browse the repository at this point in the history
BUG=None
TEST=None

Review URL: https://chromiumcodereview.appspot.com/18171002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209314 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rohitrao@chromium.org committed Jun 29, 2013
1 parent 54c4a19 commit 1c95c21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions base/ios/ios_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
namespace base {
namespace ios {

// Returns whether the operation system is iOS 6 or later.
// Returns whether the operating system is iOS 6 or later.
BASE_EXPORT bool IsRunningOnIOS6OrLater();

// Returns whether the operation system is at the given version or later.
// Returns whether the operating system is iOS 7 or later.
BASE_EXPORT bool IsRunningOnIOS7OrLater();

// Returns whether the operating system is at the given version or later.
BASE_EXPORT bool IsRunningOnOrLater(int32 major, int32 minor, int32 bug_fix);

} // namespace ios
Expand Down
4 changes: 4 additions & 0 deletions base/ios/ios_util.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ bool IsRunningOnIOS6OrLater() {
return IsRunningOnOrLater(6, 0, 0);
}

bool IsRunningOnIOS7OrLater() {
return IsRunningOnOrLater(7, 0, 0);
}

bool IsRunningOnOrLater(int32 major, int32 minor, int32 bug_fix) {
static const int32* current_version = OSVersionAsArray();
int32 version[] = { major, minor, bug_fix };
Expand Down

0 comments on commit 1c95c21

Please sign in to comment.