• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 The Chromium Authors
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 
8 #include <stdint.h>
9 
10 #include "base/base_export.h"
11 #include "base/files/file_path.h"
12 
13 namespace base {
14 namespace ios {
15 
16 // Returns whether the operating system is iOS 12 or later.
17 // TODO(crbug.com/1129482): Remove once minimum supported version is at least 12
18 BASE_EXPORT bool IsRunningOnIOS12OrLater();
19 
20 // Returns whether the operating system is iOS 13 or later.
21 // TODO(crbug.com/1129483): Remove once minimum supported version is at least 13
22 BASE_EXPORT bool IsRunningOnIOS13OrLater();
23 
24 // Returns whether the operating system is iOS 14 or later.
25 // TODO(crbug.com/1129484): Remove once minimum supported version is at least 14
26 BASE_EXPORT bool IsRunningOnIOS14OrLater();
27 
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 
32 // Returns whether the operating system is iOS 16 or later.
33 BASE_EXPORT bool IsRunningOnIOS16OrLater();
34 
35 // Returns whether the operating system is at the given version or later.
36 BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
37                                     int32_t minor,
38                                     int32_t bug_fix);
39 
40 // Returns whether iOS is signaling that an RTL text direction should be used
41 // 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
44 // example by using the "RTL Pseudolanguage" option when launching from Xcode).
45 BASE_EXPORT bool IsInForcedRTL();
46 
47 // Stores the |path| of the ICU dat file in a global to be referenced later by
48 // FilePathOfICUFile().  This should only be called once.
49 BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
50 
51 // Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
52 // returns invalid FilePath.
53 BASE_EXPORT FilePath FilePathOfEmbeddedICU();
54 
55 // 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.
58 BASE_EXPORT bool IsMultipleScenesSupported();
59 
60 // iOS 15 introduced pre-warming, which launches and then pauses the app, to
61 // speed up actual launch time.
62 BASE_EXPORT bool IsApplicationPreWarmed();
63 
64 // The iPhone 14 Pro and Pro Max introduced a dynamic island. This should only
65 // be called when working around UIKit bugs.
66 BASE_EXPORT bool HasDynamicIsland();
67 
68 }  // namespace ios
69 }  // namespace base
70 
71 #endif  // BASE_IOS_IOS_UTIL_H_
72