blob: feaf725767c4673b1412b79f653e0082e929f0a1 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2012 The Chromium Authors
[email protected]aebcd0dd2012-10-05 17:48:582// 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
Matt Muellerda639d632022-11-15 17:05:2932// Returns whether the operating system is iOS 16 or later.
33BASE_EXPORT bool IsRunningOnIOS16OrLater();
34
[email protected]1c95c212013-06-29 14:16:0035// Returns whether the operating system is at the given version or later.
avi9b6f42932015-12-26 22:15:1436BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
37 int32_t minor,
38 int32_t bug_fix);
[email protected]aebcd0dd2012-10-05 17:48:5839
Louis Romeroa10fa5a22022-10-27 01:31:2840// Returns whether iOS is signaling that an RTL text direction should be used
marqb2238de2015-09-21 17:06:2141// regardless of the current locale. This should not return true if the current
42// language is a "real" RTL language such as Arabic or Urdu; it should only
43// return true in cases where the RTL text direction has been forced (for
Louis Romeroa10fa5a22022-10-27 01:31:2844// example by using the "RTL Pseudolanguage" option when launching from Xcode).
marqf51b0032015-08-10 08:55:1745BASE_EXPORT bool IsInForcedRTL();
46
justincohenb83910d2016-01-08 23:49:4347// Stores the |path| of the ICU dat file in a global to be referenced later by
48// FilePathOfICUFile(). This should only be called once.
49BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
50
51// Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
52// returns invalid FilePath.
53BASE_EXPORT FilePath FilePathOfEmbeddedICU();
54
Sylvain Defresne226653e2021-01-21 16:36:1155// Returns true iff multiple windows can be opened, i.e. when the multiwindow
56// build flag is on, the device is running on iOS 13+ and it's a compatible
57// iPad.
58BASE_EXPORT bool IsMultipleScenesSupported();
59
Justin Cohen0d4ed232022-02-04 15:27:1660// iOS 15 introduced pre-warming, which launches and then pauses the app, to
61// speed up actual launch time.
62BASE_EXPORT bool IsApplicationPreWarmed();
63
Justin Cohen518b7442022-09-17 21:26:4964// The iPhone 14 Pro and Pro Max introduced a dynamic island. This should only
65// be called when working around UIKit bugs.
66BASE_EXPORT bool HasDynamicIsland();
67
[email protected]aebcd0dd2012-10-05 17:48:5868} // namespace ios
69} // namespace base
70
71#endif // BASE_IOS_IOS_UTIL_H_