features.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright 2017 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. #ifndef IOS_WEB_COMMON_FEATURES_H_
  5. #define IOS_WEB_COMMON_FEATURES_H_
  6. #include "base/feature_list.h"
  7. namespace web {
  8. namespace features {
  9. // Used to crash the browser if unexpected URL change is detected.
  10. // https://crbug.com/841105.
  11. extern const base::Feature kCrashOnUnexpectedURLChange;
  12. // Used to prevent native apps from being opened when a universal link is tapped
  13. // and the user is browsing in off the record mode.
  14. extern const base::Feature kBlockUniversalLinksInOffTheRecordMode;
  15. // Used to ensure that the render is not suspended.
  16. extern const base::Feature kKeepsRenderProcessAlive;
  17. // Used to enable the workaround for a WKWebView WKNavigation leak.
  18. // (crbug.com/1010765). Clear older pending navigation records when a
  19. // navigation finishes.
  20. extern const base::Feature kClearOldNavigationRecordsWorkaround;
  21. // Feature flag enabling persistent downloads.
  22. extern const base::Feature kEnablePersistentDownloads;
  23. // When enabled, preserves properties of the UIScrollView using CRWPropertyStore
  24. // when the scroll view is recreated. When disabled, only preserve a small set
  25. // of properties using hard coded logic.
  26. extern const base::Feature kPreserveScrollViewProperties;
  27. // Records snapshot size of image (IOS.Snapshots.ImageSize histogram) and PDF
  28. // (IOS.Snapshots.PDFSize histogram) if enabled. Enabling this flag will
  29. // generate PDF when Page Snapshot is taken just to record PDF size.
  30. extern const base::Feature kRecordSnapshotSize;
  31. // When enabled, the |attribution| property of NSMutableURLRequests passed to
  32. // WKWebView is set as NSURLRequestAttributionUser on iOS 15.
  33. extern const base::Feature kSetRequestAttribution;
  34. // Disables the screenshots of non-HTML pages on iOS15.
  35. extern const base::Feature kDisableNonHTMLScreenshotOnIOS15;
  36. // Feature flag that enable Shared Highlighting color change in iOS.
  37. extern const base::Feature kIOSSharedHighlightingColorChange;
  38. // Feature flag that enables native session restoration with a synthesized
  39. // interaction state.
  40. extern const base::Feature kSynthesizedRestoreSession;
  41. // Enables user control for camera and/or microphone access for a specific site
  42. // through site settings during its lifespan. When enabled, each web state will
  43. // keep track of whether camera and/or microphone access is granted by the user
  44. // for its current site.
  45. extern const base::Feature kMediaPermissionsControl;
  46. // Enables the Fullscreen API in WebKit (supported on iOS 16.0+). This API
  47. // allows web sites to enter fullscreen mode, with all browser UI hidden.
  48. extern const base::Feature kEnableFullscreenAPI;
  49. // Feature flag enabling use of new iOS 15
  50. // loadSimulatedRequest:responseHTMLString: API to display error pages in
  51. // CRWWKNavigationHandler. The helper method IsLoadSimulatedRequestAPIEnabled()
  52. // should be used instead of directly checking this feature.
  53. extern const base::Feature kUseLoadSimulatedRequestForOfflinePage;
  54. // Feature flag that enable web page detected intents annotations.
  55. extern const base::Feature kEnableWebPageAnnotations;
  56. // When true, screenshots of non-HTML (e.g. PDF) pages should be taken.
  57. bool ShouldTakeScreenshotOnNonHTMLContent();
  58. // When true, user control for camera and/or microphone access should be
  59. // enabled.
  60. bool IsMediaPermissionsControlEnabled();
  61. // When true, the new loadSimulatedRequest API should be used when displaying
  62. // error pages.
  63. bool IsLoadSimulatedRequestAPIEnabled();
  64. } // namespace features
  65. } // namespace web
  66. #endif // IOS_WEB_COMMON_FEATURES_H_