Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
Browser
Commits
74cd449d
Commit
74cd449d
authored
Jul 29, 2021
by
Aayush Gupta
Browse files
Merge tag '91.0.4472.146' of
https://github.com/bromite/bromite
into backlog_3405-all-upstream
parents
3e019522
df446ba6
Changes
23
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.md
View file @
74cd449d
# 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)
...
...
build/RELEASE
View file @
74cd449d
91.0.4472.14
3
91.0.4472.14
6
build/bromite_patches_list.txt
View file @
74cd449d
...
...
@@ -45,7 +45,6 @@ Open-YouTube-links-in-Bromite.patch
Add-exit-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
...
...
@@ -149,4 +148,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
build/patches/API-level-21-prevent-crash-on-download.patch
0 → 100644
View file @
74cd449d
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
build/patches/Add-IsCleartextPermitted-flag.patch
View file @
74cd449d
...
...
@@ -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
@@ -73
64
,6 +73
64
,11 @@
const FeatureEntry kFeatureEntries[] = {
@@ -73
58
,6 +73
58
,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
@@ -13
92
,6 +13
92
,10 @@
const char kHostedAppShimCreationName[] =
@@ -13
84
,6 +13
84
,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
@@ -8
20
,6 +8
20
,9 @@
extern const char kHostedAppQuitNotificationDescription[];
@@ -8
14
,6 +8
14
,9 @@
extern const char kHostedAppQuitNotificationDescription[];
extern const char kHostedAppShimCreationName[];
extern const char kHostedAppShimCreationDescription[];
...
...
build/patches/Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
View file @
74cd449d
...
...
@@ -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
@@ -3
105
,6 +3
105
,12 @@
const FeatureEntry kFeatureEntries[] = {
@@ -3
099
,6 +3
099
,12 @@
const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kDeprecateLowUsageCodecsName,
flag_descriptions::kDeprecateLowUsageCodecsDescription, kOsCrOS | kOsLinux,
FEATURE_VALUE_TYPE(media::kDeprecateLowUsageCodecs)},
...
...
build/patches/Add-a-proxy-configuration-page.patch
View file @
74cd449d
...
...
@@ -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
@@ -3
42
,6 +3
42
,8 @@
std::vector<std::u16string>
ChromeAutocompleteProviderClient::GetBuiltin
URL
s() {
std::vector<std::u16string>
ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
std::vector<std::u16string> builtins_to_provide;
@@ -3
50
,6 +3
50
,8 @@
ChromeAutocompleteProviderClient::GetBuiltin
sToProvideAsUserType
s() {
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::kChromeUI
ChromeURLs
URL));
#if !defined(OS_ANDROID)
base::ASCIIToUTF16(chrome::kChromeUI
Version
URL));
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
...
...
build/patches/Add-bookmark-import-export-actions.patch
View file @
74cd449d
...
...
@@ -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
@@ -73
14
,6 +73
14
,12 @@
const FeatureEntry kFeatureEntries[] = {
@@ -73
08
,6 +73
08
,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
@@ -52
30
,6 +52
30
,11 @@
const char kWebrtcPipeWireCapturerDescription[] =
@@ -52
22
,6 +52
22
,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
@@ -306
9
,6 +306
9
,9 @@
extern const char kWebrtcPipeWireCapturerName[];
@@ -306
3
,6 +306
3
,9 @@
extern const char kWebrtcPipeWireCapturerName[];
extern const char kWebrtcPipeWireCapturerDescription[];
#endif // #if defined(WEBRTC_USE_PIPEWIRE)
...
...
build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch
View file @
74cd449d
...
...
@@ -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"}};
@@ -47
75
,6 +47
91
,11 @@
const FeatureEntry kFeatureEntries[] = {
@@ -47
69
,6 +47
85
,11 @@
const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
#endif // !defined(OS_ANDROID)
...
...
build/patches/Add-flag-for-save-data-header.patch
View file @
74cd449d
...
...
@@ -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
@@ -448
8
,6 +448
8
,9 @@
const FeatureEntry kFeatureEntries[] = {
@@ -448
2
,6 +448
2
,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
@@ -5
71
,6 +5
71
,9 @@
extern const char kDiagnosticsAppDescription[];
@@ -5
65
,6 +5
65
,9 @@
extern const char kDiagnosticsAppDescription[];
extern const char kDisableKeepaliveFetchName[];
extern const char kDisableKeepaliveFetchDescription[];
...
...
build/patches/Add-flag-to-configure-maximum-connections-per-host.patch
View file @
74cd449d
...
...
@@ -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 ==
@@ -37
42
,6 +374
7
,9 @@
const FeatureEntry kFeatureEntries[] = {
@@ -37
36
,6 +374
1
,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
@@ -14
90
,6 +14
90
,10 @@
const char kMediaHistoryDescription[] =
@@ -14
82
,6 +14
82
,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
@@ -8
75
,6 +8
75
,9 @@
extern const char kLogJsConsoleMessagesDescription[];
@@ -8
69
,6 +8
69
,9 @@
extern const char kLogJsConsoleMessagesDescription[];
extern const char kMediaHistoryName[];
extern const char kMediaHistoryDescription[];
...
...
build/patches/Add-flag-to-disable-IPv6-probes.patch
View file @
74cd449d
...
...
@@ -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
@@ -474
7
,6 +474
7
,11 @@
const FeatureEntry kFeatureEntries[] = {
@@ -474
1
,6 +474
1
,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
@@ -29
85
,6 +29
85
,10 @@
const char kContextualSearchRankerQueryDescription[] =
@@ -29
77
,6 +29
77
,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
@@ -6
80
,6 +6
80
,9 @@
extern const char kEnableWasmThreadsName[];
@@ -6
74
,6 +6
74
,9 @@
extern const char kEnableWasmThreadsName[];
extern const char kEnableWasmThreadsDescription[];
extern const char kEnableWasmTieringName[];
...
...
build/patches/Add-flag-to-disable-external-intent-requests.patch
View file @
74cd449d
...
...
@@ -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
@@ -3
107
,6 +3
107
,12 @@
const char kIntentBlockExternalFormRedirectsNoGestureDescription[] =
@@ -3
099
,6 +3
099
,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
@@ -18
1
0,6 +18
1
0,9 @@
extern const char kInstantStartDescription[];
@@ -180
4
,6 +180
4
,9 @@
extern const char kInstantStartDescription[];
extern const char kIntentBlockExternalFormRedirectsNoGestureName[];
extern const char kIntentBlockExternalFormRedirectsNoGestureDescription[];
...
...
build/patches/Add-flags-to-disable-device-motion-orientation-APIs.patch
deleted
100644 → 0
View file @
3e019522
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
build/patches/Add-vibration-flag.patch
0 → 100644
View file @
74cd449d
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);
+}
+
void WebRuntimeFeatures::EnableKeyboardAccessibleTooltip(bool enable) {
RuntimeEnabledFeatures::SetKeyboardAccessibleTooltipEnabled(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
@@ -1432,6 +1432,10 @@
name: "OrientationEvent",