blob: 5c1b9af8b69184d71a566f4819cff5a17feb29e5 [file] [log] [blame]
[email protected]aebcd0dd2012-10-05 17:48:581// Copyright 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_IOS_IOS_UTIL_H_
6#define BASE_IOS_IOS_UTIL_H_
7
avi9b6f42932015-12-26 22:15:148#include <stdint.h>
9
[email protected]aebcd0dd2012-10-05 17:48:5810#include "base/base_export.h"
justincohenb83910d2016-01-08 23:49:4311#include "base/files/file_path.h"
[email protected]aebcd0dd2012-10-05 17:48:5812
13namespace base {
14namespace ios {
15
Justin Cohen8f8fd9b2018-06-13 20:03:1116// Returns whether the operating system is iOS 12 or later.
Mike Doughertya219f7a042020-09-17 17:58:3117// TODO(crbug.com/1129482): Remove once minimum supported version is at least 12
Justin Cohen8f8fd9b2018-06-13 20:03:1118BASE_EXPORT bool IsRunningOnIOS12OrLater();
19
Rohit Raoc04c972d2019-06-12 14:53:3820// Returns whether the operating system is iOS 13 or later.
Mike Doughertya219f7a042020-09-17 17:58:3121// TODO(crbug.com/1129483): Remove once minimum supported version is at least 13
Rohit Raoc04c972d2019-06-12 14:53:3822BASE_EXPORT bool IsRunningOnIOS13OrLater();
23
Rohit Rao73112552020-07-07 19:58:2124// Returns whether the operating system is iOS 14 or later.
Mike Doughertya219f7a042020-09-17 17:58:3125// TODO(crbug.com/1129484): Remove once minimum supported version is at least 14
Rohit Rao73112552020-07-07 19:58:2126BASE_EXPORT bool IsRunningOnIOS14OrLater();
27
Justin Cohen7f7b7542021-07-08 17:08:2028// Returns whether the operating system is iOS 15 or later.
29// TODO(crbug.com/1227419): Remove once minimum supported version is at least 15
30BASE_EXPORT bool IsRunningOnIOS15OrLater();
31
[email protected]1c95c212013-06-29 14:16:0032// Returns whether the operating system is at the given version or later.
avi9b6f42932015-12-26 22:15:1433BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
34 int32_t minor,
35 int32_t bug_fix);
[email protected]aebcd0dd2012-10-05 17:48:5836
marqf51b0032015-08-10 08:55:1737// Returns whether iOS is signalling that an RTL text direction should be used
marqb2238de2015-09-21 17:06:2138// regardless of the current locale. This should not return true if the current
39// language is a "real" RTL language such as Arabic or Urdu; it should only
40// return true in cases where the RTL text direction has been forced (for
41// example by using the "RTL Psuedolanguage" option when launching from XCode).
marqf51b0032015-08-10 08:55:1742BASE_EXPORT bool IsInForcedRTL();
43
justincohenb83910d2016-01-08 23:49:4344// Stores the |path| of the ICU dat file in a global to be referenced later by
45// FilePathOfICUFile(). This should only be called once.
46BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
47
48// Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
49// returns invalid FilePath.
50BASE_EXPORT FilePath FilePathOfEmbeddedICU();
51
Eugene But30162ae2020-10-13 23:50:3752// Returns true if multiwindow is supported on this OS version and is enabled in
53// the current build configuration. Does not check if this device can actually
54// show multiple windows (e.g. on iPhone): use [UIApplication
55// supportsMultipleScenes] instead.
56BASE_EXPORT bool IsMultiwindowSupported();
57
Sylvain Defresne226653e2021-01-21 16:36:1158// Returns true iff multiple windows can be opened, i.e. when the multiwindow
59// build flag is on, the device is running on iOS 13+ and it's a compatible
60// iPad.
61BASE_EXPORT bool IsMultipleScenesSupported();
62
Justin Cohen0d4ed232022-02-04 15:27:1663// iOS 15 introduced pre-warming, which launches and then pauses the app, to
64// speed up actual launch time.
65BASE_EXPORT bool IsApplicationPreWarmed();
66
[email protected]aebcd0dd2012-10-05 17:48:5867} // namespace ios
68} // namespace base
69
70#endif // BASE_IOS_IOS_UTIL_H_