blob: b5393fdbe9d1919fc46b94d4bab9b08261aa2125 [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"
Sylvain Defresne86bce6f42024-02-13 13:04:3612#include "build/ios_buildflags.h"
[email protected]aebcd0dd2012-10-05 17:48:5813
14namespace base {
15namespace ios {
16
Matt Muellerda639d632022-11-15 17:05:2917// Returns whether the operating system is iOS 16 or later.
18BASE_EXPORT bool IsRunningOnIOS16OrLater();
19
Joemer Ramos8e1ba3a2023-06-16 18:25:0920// Returns whether the operating system is iOS 17 or later.
21BASE_EXPORT bool IsRunningOnIOS17OrLater();
22
[email protected]1c95c212013-06-29 14:16:0023// Returns whether the operating system is at the given version or later.
avi9b6f42932015-12-26 22:15:1424BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
25 int32_t minor,
26 int32_t bug_fix);
[email protected]aebcd0dd2012-10-05 17:48:5827
Louis Romeroa10fa5a22022-10-27 01:31:2828// Returns whether iOS is signaling that an RTL text direction should be used
marqb2238de2015-09-21 17:06:2129// regardless of the current locale. This should not return true if the current
30// language is a "real" RTL language such as Arabic or Urdu; it should only
31// return true in cases where the RTL text direction has been forced (for
Louis Romeroa10fa5a22022-10-27 01:31:2832// example by using the "RTL Pseudolanguage" option when launching from Xcode).
marqf51b0032015-08-10 08:55:1733BASE_EXPORT bool IsInForcedRTL();
34
justincohenb83910d2016-01-08 23:49:4335// Stores the |path| of the ICU dat file in a global to be referenced later by
36// FilePathOfICUFile(). This should only be called once.
37BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
38
39// Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
40// returns invalid FilePath.
41BASE_EXPORT FilePath FilePathOfEmbeddedICU();
42
Sylvain Defresne86bce6f42024-02-13 13:04:3643#if !BUILDFLAG(IS_IOS_APP_EXTENSION)
Sylvain Defresne226653e2021-01-21 16:36:1144// Returns true iff multiple windows can be opened, i.e. when the multiwindow
45// build flag is on, the device is running on iOS 13+ and it's a compatible
46// iPad.
47BASE_EXPORT bool IsMultipleScenesSupported();
Sylvain Defresne86bce6f42024-02-13 13:04:3648#endif
Sylvain Defresne226653e2021-01-21 16:36:1149
Justin Cohen0d4ed232022-02-04 15:27:1650// iOS 15 introduced pre-warming, which launches and then pauses the app, to
51// speed up actual launch time.
52BASE_EXPORT bool IsApplicationPreWarmed();
53
[email protected]aebcd0dd2012-10-05 17:48:5854} // namespace ios
55} // namespace base
56
57#endif // BASE_IOS_IOS_UTIL_H_