• 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 iOS 17 or later.
36 BASE_EXPORT bool IsRunningOnIOS17OrLater();
37 
38 // Returns whether the operating system is at the given version or later.
39 BASE_EXPORT bool IsRunningOnOrLater(int32_t major,
40                                     int32_t minor,
41                                     int32_t bug_fix);
42 
43 // Returns whether iOS is signaling that an RTL text direction should be used
44 // regardless of the current locale. This should not return true if the current
45 // language is a "real" RTL language such as Arabic or Urdu; it should only
46 // return true in cases where the RTL text direction has been forced (for
47 // example by using the "RTL Pseudolanguage" option when launching from Xcode).
48 BASE_EXPORT bool IsInForcedRTL();
49 
50 // Stores the |path| of the ICU dat file in a global to be referenced later by
51 // FilePathOfICUFile().  This should only be called once.
52 BASE_EXPORT void OverridePathOfEmbeddedICU(const char* path);
53 
54 // Returns the overriden path set by OverridePathOfEmbeddedICU(), otherwise
55 // returns invalid FilePath.
56 BASE_EXPORT FilePath FilePathOfEmbeddedICU();
57 
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 
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 
67 // The iPhone 14 Pro and Pro Max introduced a dynamic island. This should only
68 // be called when working around UIKit bugs.
69 BASE_EXPORT bool HasDynamicIsland();
70 
71 }  // namespace ios
72 }  // namespace base
73 
74 #endif  // BASE_IOS_IOS_UTIL_H_
75