Commit df446ba6 authored by csagan5's avatar csagan5
Browse files

Release 91.0.4472.146

parent 5efb5dd7
# 91.0.4472.146
* removed flags for device motion/orientation (fixes https://github.com/bromite/bromite/issues/1204)
* prevent crash on download on API level 21 (fixes https://github.com/bromite/bromite/issues/1184)
* fix crash reporting garbled UI for small screens (thanks to @uazo, https://github.com/bromite/bromite/pull/1236)
* add flag to enable/disable vibration API (fixes https://github.com/bromite/bromite/issues/1045)
# 91.0.4472.143
* add support for ISupportHelpAndFeedback
* JIT-less toggle (fixes https://github.com/bromite/bromite/issues/1235)
......
......@@ -85,7 +85,6 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
* disable video autoplay by default, reintroduce site settings
* mobile/desktop user agent customization
* accessibility preference to force tablet UI
* use Alt+D to focus address bar
You can inspect all functionality/privacy changes by reading the [patches](https://github.com/bromite/bromite/tree/master/build/patches) and/or the [CHANGELOG](./CHANGELOG.md).
......
91.0.4472.143
91.0.4472.146
......@@ -48,7 +48,6 @@ Add-exit-menu-item.patch
Remove-help-menu-item.patch
AudioBuffer-AnalyserNode-fp-mitigations.patch
Multiple-fingerprinting-mitigations.patch
Add-flags-to-disable-device-motion-orientation-APIs.patch
Disable-metrics-on-all-I-O-threads.patch
Always-respect-async-dns-flag-regardless-of-SDK-version.patch
Add-flag-to-configure-maximum-connections-per-host.patch
......@@ -154,4 +153,6 @@ Add-flag-to-disable-external-intent-requests.patch
Logcat-crash-reports-UI.patch
Add-support-for-ISupportHelpAndFeedback.patch
JIT-less-toggle.patch
API-level-21-prevent-crash-on-download.patch
Add-vibration-flag.patch
Automated-domain-substitution.patch
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 16:53:48 +0200
Subject: API level 21: prevent crash on download
On Lollipop 5.0.x it is not possible to use the system persistent bundle.
This patch ignores boolean settings for them and prevents the crash.
See also: https://github.com/bromite/bromite/issues/1184
---
.../internal/BundleToPersistableBundleConverter.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -85,9 +85,17 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);
} else if (obj instanceof Boolean) {
- persistableBundle.putBoolean(key, (Boolean) obj);
+ if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBoolean(key, (Boolean) obj);
+ }
} else if (obj instanceof boolean[]) {
- persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP {
+ failedKeys.add(key);
+ } else {
+ persistableBundle.putBooleanArray(key, (boolean[]) obj);
+ }
} else if (obj instanceof Double) {
persistableBundle.putDouble(key, (Double) obj);
} else if (obj instanceof double[]) {
--
2.17.1
......@@ -14,7 +14,7 @@ Subject: Add IsCleartextPermitted flag
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7364,6 +7364,11 @@ const FeatureEntry kFeatureEntries[] = {
@@ -7358,6 +7358,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
chrome::android::kBookmarksExportUseSaf)},
......@@ -29,7 +29,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1392,6 +1392,10 @@ const char kHostedAppShimCreationName[] =
@@ -1384,6 +1384,10 @@ const char kHostedAppShimCreationName[] =
const char kHostedAppShimCreationDescription[] =
"Create app shims on Mac when creating a hosted app.";
......@@ -43,7 +43,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -820,6 +820,9 @@ extern const char kHostedAppQuitNotificationDescription[];
@@ -814,6 +814,9 @@ extern const char kHostedAppQuitNotificationDescription[];
extern const char kHostedAppShimCreationName[];
extern const char kHostedAppShimCreationDescription[];
......
......@@ -17,7 +17,7 @@ See also:
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3105,6 +3105,12 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3099,6 +3099,12 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kDeprecateLowUsageCodecsName,
flag_descriptions::kDeprecateLowUsageCodecsDescription, kOsCrOS | kOsLinux,
FEATURE_VALUE_TYPE(media::kDeprecateLowUsageCodecs)},
......
......@@ -81,15 +81,15 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -342,6 +342,8 @@ std::vector<std::u16string> ChromeAutocompleteProviderClient::GetBuiltinURLs() {
std::vector<std::u16string>
ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
std::vector<std::u16string> builtins_to_provide;
@@ -350,6 +350,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
#endif
+ builtins_to_provide.push_back(
+ base::ASCIIToUTF16(chrome::kChromeUIProxyConfigURL));
builtins_to_provide.push_back(
base::ASCIIToUTF16(chrome::kChromeUIChromeURLsURL));
#if !defined(OS_ANDROID)
base::ASCIIToUTF16(chrome::kChromeUIVersionURL));
return builtins_to_provide;
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
......
......@@ -738,7 +738,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7314,6 +7314,12 @@ const FeatureEntry kFeatureEntries[] = {
@@ -7308,6 +7308,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kDesktopPWAsAppIconShortcutsMenuUI)},
#endif
......@@ -1257,7 +1257,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -5230,6 +5230,11 @@ const char kWebrtcPipeWireCapturerDescription[] =
@@ -5222,6 +5222,11 @@ const char kWebrtcPipeWireCapturerDescription[] =
"capturing the desktop content on the Wayland display server.";
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
......@@ -1272,7 +1272,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -3069,6 +3069,9 @@ extern const char kWebrtcPipeWireCapturerName[];
@@ -3063,6 +3063,9 @@ extern const char kWebrtcPipeWireCapturerName[];
extern const char kWebrtcPipeWireCapturerDescription[];
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
......
......@@ -38,7 +38,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
#if defined(OS_ANDROID)
const FeatureEntry::FeatureParam kHideDismissButton[] = {
{"dismiss_button", "hide"}};
@@ -4775,6 +4791,11 @@ const FeatureEntry kFeatureEntries[] = {
@@ -4769,6 +4785,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
#endif // !defined(OS_ANDROID)
......
......@@ -14,7 +14,7 @@ Subject: Add flag for save-data-header
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4488,6 +4488,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -4482,6 +4482,9 @@ const FeatureEntry kFeatureEntries[] = {
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
#if defined(OS_ANDROID)
......@@ -27,7 +27,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1006,6 +1006,10 @@ const char kDisableKeepaliveFetchDescription[] =
@@ -998,6 +998,10 @@ const char kDisableKeepaliveFetchDescription[] =
"Disable fetch with keepalive set "
"(https://fetch.spec.whatwg.org/#request-keepalive-flag).";
......@@ -41,7 +41,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -571,6 +571,9 @@ extern const char kDiagnosticsAppDescription[];
@@ -565,6 +565,9 @@ extern const char kDiagnosticsAppDescription[];
extern const char kDisableKeepaliveFetchName[];
extern const char kDisableKeepaliveFetchDescription[];
......
......@@ -31,7 +31,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
// Ensure that all effective connection types returned by Network Quality
// Estimator (NQE) are also exposed via flags.
static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
@@ -3742,6 +3747,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3736,6 +3741,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kAndroidPictureInPictureAPIName,
flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
......@@ -44,7 +44,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -1490,6 +1490,10 @@ const char kMediaHistoryDescription[] =
@@ -1482,6 +1482,10 @@ const char kMediaHistoryDescription[] =
"Enables Media History which records data around media playbacks on "
"websites.";
......@@ -58,7 +58,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -875,6 +875,9 @@ extern const char kLogJsConsoleMessagesDescription[];
@@ -869,6 +869,9 @@ extern const char kLogJsConsoleMessagesDescription[];
extern const char kMediaHistoryName[];
extern const char kMediaHistoryDescription[];
......
......@@ -16,7 +16,7 @@ Subject: Add flag to disable IPv6 probes
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4747,6 +4747,11 @@ const FeatureEntry kFeatureEntries[] = {
@@ -4741,6 +4741,11 @@ const FeatureEntry kFeatureEntries[] = {
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)
......@@ -31,7 +31,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2985,6 +2985,10 @@ const char kContextualSearchRankerQueryDescription[] =
@@ -2977,6 +2977,10 @@ const char kContextualSearchRankerQueryDescription[] =
const char kContextualSearchSecondTapName[] =
"Contextual Search second tap triggering";
......@@ -45,7 +45,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -680,6 +680,9 @@ extern const char kEnableWasmThreadsName[];
@@ -674,6 +674,9 @@ extern const char kEnableWasmThreadsName[];
extern const char kEnableWasmThreadsDescription[];
extern const char kEnableWasmTieringName[];
......
......@@ -24,7 +24,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3107,6 +3107,12 @@ const char kIntentBlockExternalFormRedirectsNoGestureDescription[] =
@@ -3099,6 +3099,12 @@ const char kIntentBlockExternalFormRedirectsNoGestureDescription[] =
"Require a user gesture that triggered a form submission in order to "
"allow for redirecting to an external intent.";
......@@ -40,7 +40,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1810,6 +1810,9 @@ extern const char kInstantStartDescription[];
@@ -1804,6 +1804,9 @@ extern const char kInstantStartDescription[];
extern const char kIntentBlockExternalFormRedirectsNoGestureName[];
extern const char kIntentBlockExternalFormRedirectsNoGestureDescription[];
......
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 22 Oct 2018 21:29:53 +0200
Subject: Add flags to disable device motion/orientation APIs
Both flags will be disabled by default and prevent usage of gyroscope and
legacy acceleration events.
---
chrome/browser/about_flags.cc | 6 ++++++
chrome/browser/flag_descriptions.cc | 8 ++++++++
chrome/browser/flag_descriptions.h | 6 ++++++
content/child/runtime_features.cc | 3 +++
content/public/common/content_features.cc | 10 ++++++++++
content/public/common/content_features.h | 2 ++
.../blink/public/platform/web_runtime_features.h | 2 ++
.../blink/renderer/modules/modules_initializer.cc | 10 +++++++---
.../renderer/platform/exported/web_runtime_features.cc | 8 ++++++++
.../renderer/platform/runtime_enabled_features.json5 | 8 ++++++++
10 files changed, 60 insertions(+), 3 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2848,6 +2848,12 @@ const FeatureEntry kFeatureEntries[] = {
{"enable-gpu-rasterization", flag_descriptions::kGpuRasterizationName,
flag_descriptions::kGpuRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableGpuRasterizationChoices)},
+ {"enable-device-motion", flag_descriptions::kEnableDeviceMotionName,
+ flag_descriptions::kEnableDeviceMotionDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceMotion)},
+ {"enable-device-orientation", flag_descriptions::kEnableDeviceOrientationName,
+ flag_descriptions::kEnableDeviceOrientationDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kDeviceOrientation)},
{"enable-oop-rasterization", flag_descriptions::kOopRasterizationName,
flag_descriptions::kOopRasterizationDescription, kOsAll,
MULTI_VALUE_TYPE(kEnableOopRasterizationChoices)},
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -844,6 +844,14 @@ const char kWinrtGeolocationImplementationDescription[] =
"Enables usage of the Windows.Devices.Geolocation WinRT APIs on Windows "
"for geolocation";
+const char kEnableDeviceMotionName[] = "Enable device motion";
+const char kEnableDeviceMotionDescription[] =
+ "Enable device motion API which is used to detect changes in acceleration";
+
+const char kEnableDeviceOrientationName[] = "Enable device orientation";
+const char kEnableDeviceOrientationDescription[] =
+ "Enable device orientation API which is used to detect changes in orientation";
+
const char kEnableGenericSensorExtraClassesName[] =
"Generic Sensor Extra Classes";
const char kEnableGenericSensorExtraClassesDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -505,6 +505,12 @@ extern const char kNotificationsViaHelperAppDescription[];
extern const char kWinrtGeolocationImplementationName[];
extern const char kWinrtGeolocationImplementationDescription[];
+extern const char kEnableDeviceMotionName[];
+extern const char kEnableDeviceMotionDescription[];
+
+extern const char kEnableDeviceOrientationName[];
+extern const char kEnableDeviceOrientationDescription[];
+
extern const char kEnableGenericSensorExtraClassesName[];
extern const char kEnableGenericSensorExtraClassesDescription[];
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -89,6 +89,9 @@ void SetRuntimeFeatureDefaultsForPlatform(
command_line.HasSwitch(
blink::switches::kEnableGpuMemoryBufferCompositorResources) &&
!command_line.HasSwitch(switches::kDisableWebGLImageChromium) &&
+ WebRuntimeFeatures::EnableDeviceMotion(base::FeatureList::IsEnabled(features::kDeviceMotion));
+ WebRuntimeFeatures::EnableDeviceOrientation(base::FeatureList::IsEnabled(features::kDeviceOrientation));
+
!command_line.HasSwitch(switches::kDisableGpu) &&
base::FeatureList::IsEnabled(features::kWebGLImageChromium);
#else
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -890,6 +890,16 @@ const base::Feature kWebOtpBackendAuto{"WebOtpBackendAuto",
// The JavaScript API for payments on the web.
const base::Feature kWebPayments{"WebPayments",
base::FEATURE_ENABLED_BY_DEFAULT};
+// Enables the device motion API used to track device acceleration;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceMotion{"DeviceMotion",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
+// Enables the device orientation API used to track device orientation;
+// no user authorization or notifications happens when in use.
+const base::Feature kDeviceOrientation{"DeviceOrientation",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
// Minimal user interface experience for payments on the web.
const base::Feature kWebPaymentsMinimalUI{"WebPaymentsMinimalUI",
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -212,6 +212,8 @@ CONTENT_EXPORT extern const base::Feature kWebXrHandInput;
CONTENT_EXPORT extern const base::Feature kWebXrHitTest;
CONTENT_EXPORT extern const base::Feature kWebXrIncubations;
+CONTENT_EXPORT extern const base::Feature kDeviceMotion, kDeviceOrientation;
+
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const base::Feature kAndroidAutofillAccessibility;
CONTENT_EXPORT extern const base::Feature
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -97,6 +97,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableCookiesWithoutSameSiteMustBeSecure(
bool);
BLINK_PLATFORM_EXPORT static void EnableCanvas2dImageChromium(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceMotion(bool);
+ BLINK_PLATFORM_EXPORT static void EnableDeviceOrientation(bool);
BLINK_PLATFORM_EXPORT static void EnableCooperativeScheduling(bool);
BLINK_PLATFORM_EXPORT static void EnableCSSHexAlphaColor(bool);
BLINK_PLATFORM_EXPORT static void EnableSameSiteByDefaultCookies(bool);
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
--- a/third_party/blink/renderer/modules/modules_initializer.cc
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
@@ -231,9 +231,13 @@ void ModulesInitializer::OnClearWindowObjectInMainWorld(
Document& document,
const Settings& settings) const {
LocalDOMWindow& window = *document.domWindow();
- DeviceMotionController::From(window);
- DeviceOrientationController::From(window);
- DeviceOrientationAbsoluteController::From(window);
+ if (RuntimeEnabledFeatures::DeviceMotionEnabled())
+ DeviceMotionController::From(window);
+ if (RuntimeEnabledFeatures::DeviceOrientationEnabled()) {
+ DeviceOrientationController::From(window);
+ DeviceOrientationAbsoluteController::From(window);
+ }
+
NavigatorGamepad::From(*window.navigator());
// TODO(nhiroki): Figure out why ServiceWorkerContainer needs to be eagerly
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -187,6 +187,14 @@ void WebRuntimeFeatures::EnableKeyboardAccessibleTooltip(bool enable) {
RuntimeEnabledFeatures::SetKeyboardAccessibleTooltipEnabled(enable);
}
+void WebRuntimeFeatures::EnableDeviceMotion(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceMotionEnabled(enable);
+}
+
+void WebRuntimeFeatures::EnableDeviceOrientation(bool enable) {
+ RuntimeEnabledFeatures::SetDeviceOrientationEnabled(enable);
+}
+
void WebRuntimeFeatures::EnableKeyboardFocusableScrollers(bool enable) {
RuntimeEnabledFeatures::SetKeyboardFocusableScrollersEnabled(enable);
}
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1423,6 +1423,14 @@
name: "OffscreenCanvasCommit",
status: "experimental",
},
+ {
+ name: "DeviceMotion",
+ status: "stable",
+ },
+ {
+ name: "DeviceOrientation",
+ status: "stable",
+ },
{
name: "OnDeviceChange",
// Android does not yet support SystemMonitor.
--
2.17.1
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Jun 2021 17:35:39 +0200
Subject: Add vibration flag
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 3 +++
.../internal/BundleToPersistableBundleConverter.java | 4 ++--
content/child/runtime_features.cc | 1 +
content/public/common/content_features.cc | 3 +++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 1 +
.../blink/renderer/modules/vibration/vibration_controller.cc | 4 ++++
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
11 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -6296,6 +6296,10 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kNotificationsViaHelperApp)},
#endif
+ {"enable-vibration", flag_descriptions::kEnableVibrationName,
+ flag_descriptions::kEnableVibrationDescription, kOsAll,
+ FEATURE_VALUE_TYPE(features::kVibration)},
+
#if BUILDFLAG(IS_CHROMEOS_ASH)
{"exo-gamepad-vibration", flag_descriptions::kExoGamepadVibrationName,
flag_descriptions::kExoGamepadVibrationDescription, kOsCrOS,
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -5004,6 +5004,9 @@ const char kWifiSyncAndroidDescription[] =
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+const char kEnableVibrationName[] = "Vibration";
+const char kEnableVibrationDescription[] = "Enable vibration API; an user gesture will still be needed.";
+
#if defined(OS_CHROMEOS)
const char kDeprecateLowUsageCodecsName[] = "Deprecates low usage media codecs";
const char kDeprecateLowUsageCodecsDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -2921,6 +2921,9 @@ extern const char kWifiSyncAndroidDescription[];
#endif // #if BUILDFLAG(IS_CHROMEOS_ASH)
+extern const char kEnableVibrationName[];
+extern const char kEnableVibrationDescription[];
+
#if defined(OS_CHROMEOS)
extern const char kDeprecateLowUsageCodecsName[];
extern const char kDeprecateLowUsageCodecsDescription[];
diff --git a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
--- a/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
+++ b/components/background_task_scheduler/internal/android/java/src/org/chromium/components/background_task_scheduler/internal/BundleToPersistableBundleConverter.java
@@ -85,13 +85,13 @@ class BundleToPersistableBundleConverter {
if (obj == null) {
persistableBundle.putString(key, null);
} else if (obj instanceof Boolean) {
- if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP {
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
failedKeys.add(key);
} else {
persistableBundle.putBoolean(key, (Boolean) obj);
}
} else if (obj instanceof boolean[]) {
- if Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP {
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
failedKeys.add(key);
} else {
persistableBundle.putBooleanArray(key, (boolean[]) obj);
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -100,6 +100,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
#if defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
WebRuntimeFeatures::EnableMediaSession(false);
+ WebRuntimeFeatures::EnableVibration(base::FeatureList::IsEnabled(features::kVibration));
#endif
#if defined(OS_ANDROID)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -87,6 +87,9 @@ const base::Feature kBackForwardCache{"BackForwardCache",
// BackForwardCacheMemoryControls is enabled only on Android to disable
// BackForwardCache for lower memory devices due to memory limiations.
#if defined(OS_ANDROID)
+// Enables vibration; an user gesture will still be required if enabled.
+const base::Feature kVibration{"Vibration",
+ base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kBackForwardCacheMemoryControls{
"BackForwardCacheMemoryControls", base::FEATURE_ENABLED_BY_DEFAULT};
#else
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -222,6 +222,8 @@ CONTENT_EXPORT extern const base::Feature kWarmUpNetworkProcess;
CONTENT_EXPORT extern const base::Feature kWebNfc;
#endif // defined(OS_ANDROID)
+CONTENT_EXPORT extern const base::Feature kVibration;
+
#if defined(OS_MAC)
CONTENT_EXPORT extern const base::Feature kDesktopCaptureMacV2;
CONTENT_EXPORT extern const base::Feature kWindowCaptureMacV2;
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -89,6 +89,7 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableBlockingFocusWithoutUserActivation(
bool);
BLINK_PLATFORM_EXPORT static void EnableCacheInlineScriptCode(bool);
+ BLINK_PLATFORM_EXPORT static void EnableVibration(bool);
BLINK_PLATFORM_EXPORT static void EnableCapabilityDelegationPaymentRequest(
bool enable);
BLINK_PLATFORM_EXPORT static void EnableClickPointerEvent(bool enable);
diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.cc b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
--- a/third_party/blink/renderer/modules/vibration/vibration_controller.cc
+++ b/third_party/blink/renderer/modules/vibration/vibration_controller.cc
@@ -29,6 +29,7 @@
#include "third_party/blink/renderer/core/frame/navigator.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/mojo/mojo_helper.h"
+#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
// Maximum number of entries in a vibration pattern.
const unsigned kVibrationPatternLengthMax = 99;
@@ -142,6 +143,9 @@ bool VibrationController::vibrate(Navigator& navigator,
// reference to |window| or |navigator| was retained in another window.
if (!navigator.DomWindow())
return false;
+ if (!RuntimeEnabledFeatures::VibrationEnabled())
+ return false;
+ }
return From(navigator).Vibrate(pattern);
}
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -183,6 +183,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
}
+void WebRuntimeFeatures::EnableVibration(bool enable) {
+ RuntimeEnabledFeatures::SetVibrationEnabled(enable);
+}