[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_IOS_IOS_UTIL_H_ |
| 6 | #define BASE_IOS_IOS_UTIL_H_ |
| 7 | |
avi | 9b6f4293 | 2015-12-26 22:15:14 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 10 | #include "base/base_export.h" |
justincohen | b83910d | 2016-01-08 23:49:43 | [diff] [blame] | 11 | #include "base/files/file_path.h" |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 12 | |
| 13 | namespace base { |
| 14 | namespace ios { |
| 15 | |
Justin Cohen | 8f8fd9b | 2018-06-13 20:03:11 | [diff] [blame] | 16 | // Returns whether the operating system is iOS 12 or later. |
Mike Dougherty | a219f7a04 | 2020-09-17 17:58:31 | [diff] [blame] | 17 | // TODO(crbug.com/1129482): Remove once minimum supported version is at least 12 |
Justin Cohen | 8f8fd9b | 2018-06-13 20:03:11 | [diff] [blame] | 18 | BASE_EXPORT bool IsRunningOnIOS12OrLater(); |
| 19 | |
Rohit Rao | c04c972d | 2019-06-12 14:53:38 | [diff] [blame] | 20 | // Returns whether the operating system is iOS 13 or later. |
Mike Dougherty | a219f7a04 | 2020-09-17 17:58:31 | [diff] [blame] | 21 | // TODO(crbug.com/1129483): Remove once minimum supported version is at least 13 |
Rohit Rao | c04c972d | 2019-06-12 14:53:38 | [diff] [blame] | 22 | BASE_EXPORT bool IsRunningOnIOS13OrLater(); |
| 23 | |
Rohit Rao | 7311255 | 2020-07-07 19:58:21 | [diff] [blame] | 24 | // Returns whether the operating system is iOS 14 or later. |
Mike Dougherty | a219f7a04 | 2020-09-17 17:58:31 | [diff] [blame] | 25 | // TODO(crbug.com/1129484): Remove once minimum supported version is at least 14 |
Rohit Rao | 7311255 | 2020-07-07 19:58:21 | [diff] [blame] | 26 | BASE_EXPORT bool IsRunningOnIOS14OrLater(); |
| 27 | |
Justin Cohen | 7f7b754 | 2021-07-08 17:08:20 | [diff] [blame] | 28 | // Returns whether the operating system is iOS 15 or later. |
| 29 | // TODO(crbug.com/1227419): Remove once minimum supported version is at least 15 |
| 30 | BASE_EXPORT bool IsRunningOnIOS15OrLater(); |
| 31 | |
[email protected] | 1c95c21 | 2013-06-29 14:16:00 | [diff] [blame] | 32 | // Returns whether the operating system is at the given version or later. |
avi | 9b6f4293 | 2015-12-26 22:15:14 | [diff] [blame] | 33 | BASE_EXPORT bool IsRunningOnOrLater(int32_t major, |
| 34 | int32_t minor, |
| 35 | int32_t bug_fix); |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 36 | |
marq | f51b003 | 2015-08-10 08:55:17 | [diff] [blame] | 37 | // Returns whether iOS is signalling that an RTL text direction should be used |
marq | b2238de | 2015-09-21 17:06:21 | [diff] [blame] | 38 | // 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). |
marq | f51b003 | 2015-08-10 08:55:17 | [diff] [blame] | 42 | BASE_EXPORT bool IsInForcedRTL(); |
| 43 | |
justincohen | b83910d | 2016-01-08 23:49:43 | [diff] [blame] | 44 | // Stores the |path| of the ICU dat file in a global to be referenced later by |
| 45 | // FilePathOfICUFile(). This should only be called once. |
| 46 | BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path); |
| 47 | |
| 48 | // Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise |
| 49 | // returns invalid FilePath. |
| 50 | BASE_EXPORT FilePath FilePathOfEmbeddedICU(); |
| 51 | |
Eugene But | 30162ae | 2020-10-13 23:50:37 | [diff] [blame] | 52 | // 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. |
| 56 | BASE_EXPORT bool IsMultiwindowSupported(); |
| 57 | |
Sylvain Defresne | 226653e | 2021-01-21 16:36:11 | [diff] [blame] | 58 | // 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. |
| 61 | BASE_EXPORT bool IsMultipleScenesSupported(); |
| 62 | |
Justin Cohen | 0d4ed23 | 2022-02-04 15:27:16 | [diff] [blame^] | 63 | // iOS 15 introduced pre-warming, which launches and then pauses the app, to |
| 64 | // speed up actual launch time. |
| 65 | BASE_EXPORT bool IsApplicationPreWarmed(); |
| 66 | |
[email protected] | aebcd0dd | 2012-10-05 17:48:58 | [diff] [blame] | 67 | } // namespace ios |
| 68 | } // namespace base |
| 69 | |
| 70 | #endif // BASE_IOS_IOS_UTIL_H_ |