Skip to content

Commit

Permalink
Merge pull request #538 from uazo/new-method-change-flags
Browse files Browse the repository at this point in the history
Add support to "Cromite" flags
  • Loading branch information
uazo authored Nov 29, 2023
2 parents 26e7007 + 21b9789 commit 49a7e0f
Show file tree
Hide file tree
Showing 108 changed files with 3,238 additions and 4,413 deletions.
2 changes: 1 addition & 1 deletion build/bromite_patches_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ Timezone-customization.patch
00Disable-Service-and-Shared-workers-on-3P-iframe.patch
00Disable-Real-Box.patch
00Always-allow-inspect-fallback.patch
00Add-cromite-flags-support.patch

00Temp-PerformanceNavigationTiming-privacy-fix.patch

00Temp-Disable-kAutomaticLazyFrameLoadingToEmbeds.patch
00Temp-disable-predictive-back-gesture.patch
00TEMP-Add-a-log-to-track-strange-behavior.patch
00Temp-guard-FileSystemAccessPersistentPermissions.patch
Expand Down
23 changes: 9 additions & 14 deletions build/patches/00Add-a-flag-to-disable-GamePad-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
chrome/browser/flag-metadata.json | 4 ++--
chrome/browser/flag_descriptions.cc | 2 +-
device/gamepad/public/cpp/gamepad_features.cc | 4 ++--
device/gamepad/public/cpp/gamepad_features.cc | 1 +
.../blink/renderer/modules/gamepad/navigator_gamepad.cc | 6 ++++++
4 files changed, 11 insertions(+), 5 deletions(-)
4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -7341,9 +7341,9 @@
@@ -7317,9 +7317,9 @@
"expiry_milestone": 121
},
{
Expand All @@ -29,7 +29,7 @@ diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.js
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
@@ -3076,7 +3076,7 @@ const char kReduceAcceptLanguageDescription[] =
@@ -3017,7 +3017,7 @@ const char kReduceAcceptLanguageDescription[] =

const char kRestrictGamepadAccessName[] = "Restrict gamepad access";
const char kRestrictGamepadAccessDescription[] =
Expand All @@ -41,17 +41,12 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
diff --git a/device/gamepad/public/cpp/gamepad_features.cc b/device/gamepad/public/cpp/gamepad_features.cc
--- a/device/gamepad/public/cpp/gamepad_features.cc
+++ b/device/gamepad/public/cpp/gamepad_features.cc
@@ -27,8 +27,8 @@ BASE_FEATURE(kEnableWindowsGamingInputDataFetcher,
base::FEATURE_ENABLED_BY_DEFAULT);
@@ -65,4 +65,5 @@ bool IsGamepadMultitouchEnabled() {
return false;
}

BASE_FEATURE(kRestrictGamepadAccess,
- "RestrictGamepadAccess",
- base::FEATURE_DISABLED_BY_DEFAULT);
+ "RestrictGamepadAccess", // enabled
+ base::FEATURE_ENABLED_BY_DEFAULT); // in bromite

// Enables gamepad multitouch
BASE_FEATURE(kEnableGamepadMultitouch,
+SET_CROMITE_FEATURE_ENABLED(kRestrictGamepadAccess);
} // namespace features
diff --git a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
--- a/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
+++ b/third_party/blink/renderer/modules/gamepad/navigator_gamepad.cc
Expand Down
1,167 changes: 1,167 additions & 0 deletions build/patches/00Add-cromite-flags-support.patch

Large diffs are not rendered by default.

104 changes: 32 additions & 72 deletions build/patches/00Add-setting-to-invert-tap-and-long-tap.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,26 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
.../contextmenu/ChromeContextMenuItem.java | 5 ++-
.../ChromeContextMenuPopulator.java | 5 +++
.../tab/TabContextMenuItemDelegate.java | 8 +++++
chrome/browser/about_flags.cc | 5 +++
.../contextmenu/ContextMenuItemDelegate.java | 2 ++
chrome/browser/flag_descriptions.cc | 4 +++
chrome/browser/flag_descriptions.h | 3 ++
.../flags/android/chrome_feature_list.cc | 1 +
.../browser/flags/ChromeFeatureList.java | 5 +++
.../strings/android_chrome_strings.grd | 9 +++++
.../res/xml/accessibility_preferences.xml | 5 +++
.../accessibility/AccessibilitySettings.java | 11 ++++++
.../AccessibilitySettingsDelegate.java | 2 ++
third_party/blink/common/features.cc | 4 +++
third_party/blink/public/common/features.h | 2 ++
...Add-setting-to-invert-tap-and-long-tap.inc | 8 +++++
...Add-setting-to-invert-tap-and-long-tap.inc | 3 ++
...Add-setting-to-invert-tap-and-long-tap.inc | 1 +
.../renderer/core/html/html_anchor_element.cc | 35 +++++++++++++++----
.../renderer/core/html/html_anchor_element.h | 9 +++--
.../renderer/core/html/html_image_element.cc | 17 +++++++++
.../renderer/core/html/html_image_element.h | 2 ++
.../core/page/context_menu_controller.cc | 32 ++++++++++++-----
.../core/page/context_menu_controller.h | 5 +--
23 files changed, 170 insertions(+), 20 deletions(-)
21 files changed, 164 insertions(+), 20 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
create mode 100644 cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
create mode 100644 cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc

diff --git a/chrome/android/java/res/values/ids.xml b/chrome/android/java/res/values/ids.xml
--- a/chrome/android/java/res/values/ids.xml
Expand Down Expand Up @@ -142,21 +143,6 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabContextM
@Override
public void onOpenImageInNewTab(GURL url, Referrer referrer) {
LoadUrlParams loadUrlParams = new LoadUrlParams(url.getSpec());
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
@@ -8425,6 +8425,11 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(features::kElasticOverscroll)},
#endif

+ {"show-always-context-menu-on-links",
+ flag_descriptions::kShowAlwaysContextMenuOnLinksName,
+ flag_descriptions::kShowAlwaysContextMenuOnLinksDescription, kOsAndroid,
+ FEATURE_VALUE_TYPE(blink::features::kShowAlwaysContextMenuOnLinks)},
+
{"device-posture", flag_descriptions::kDevicePostureName,
flag_descriptions::kDevicePostureDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kDevicePosture)},
diff --git a/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItemDelegate.java b/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItemDelegate.java
--- a/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItemDelegate.java
+++ b/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuItemDelegate.java
Expand All @@ -169,33 +155,6 @@ diff --git a/chrome/browser/contextmenu/java/src/org/chromium/chrome/browser/con
/**
* Called when the {@code url} is of an image and should be opened in a new tab.
* @param url The image URL to open.
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
@@ -2056,6 +2056,10 @@ const char kMoveTopToolbarToBottomName[] = "Move top toolbar to bottom";
const char kMoveTopToolbarToBottomDescription[] =
"Move the top toolbar to the bottom.";

+const char kShowAlwaysContextMenuOnLinksName[] = "Always show contextmenu on links";
+const char kShowAlwaysContextMenuOnLinksDescription[] =
+ "Use accessibility settings to set it.";
+
const char kIncognitoDownloadsWarningName[] =
"Enable Incognito downloads warning";
const char kIncognitoDownloadsWarningDescription[] =
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
@@ -1165,6 +1165,9 @@ extern const char kImprovedKeyboardShortcutsDescription[];
extern const char kMoveTopToolbarToBottomName[];
extern const char kMoveTopToolbarToBottomDescription[];

+extern const char kShowAlwaysContextMenuOnLinksName[];
+extern const char kShowAlwaysContextMenuOnLinksDescription[];
+
extern const char kIncognitoReauthenticationForAndroidName[];
extern const char kIncognitoReauthenticationForAndroidDescription[];

diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
Expand Down Expand Up @@ -331,32 +290,33 @@ diff --git a/components/browser_ui/accessibility/android/java/src/org/chromium/c
/**
* @return The BrowserContextHandle that should be used to read and update settings.
*/
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -241,6 +241,10 @@ BASE_FEATURE(kBackgroundResourceFetch,
"BackgroundResourceFetch",
base::FEATURE_DISABLED_BY_DEFAULT);

+BASE_FEATURE(kShowAlwaysContextMenuOnLinks,
+ "ShowAlwaysContextMenuOnLinks",
+ base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/chrome/browser/about_flags_cc/Add-setting-to-invert-tap-and-long-tap.inc
@@ -0,0 +1,8 @@
+#ifdef FLAG_SECTION
+
// Used to configure a per-origin allowlist of performance.mark events that are
// permitted to be included in slow reports traces. See crbug.com/1181774.
BASE_FEATURE(kBackgroundTracingPerformanceMark,
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h
--- a/third_party/blink/public/common/features.h
+++ b/third_party/blink/public/common/features.h
@@ -143,6 +143,8 @@ BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackForwardCacheWithKeepaliveRequest);

BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackgroundResourceFetch);

+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kShowAlwaysContextMenuOnLinks);
+ {"show-always-context-menu-on-links",
+ "Always show contextmenu on links",
+ "Use accessibility settings to set it.", kOsAndroid,
+ FEATURE_VALUE_TYPE(blink::features::kShowAlwaysContextMenuOnLinks)},
+
// Used to configure a per-origin allowlist of performance.mark events that are
// permitted to be included in slow reports traces. See crbug.com/1181774.
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kBackgroundTracingPerformanceMark);
+#endif
diff --git a/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/third_party/blink/common/features_cc/Add-setting-to-invert-tap-and-long-tap.inc
@@ -0,0 +1,3 @@
+CROMITE_FEATURE(kShowAlwaysContextMenuOnLinks,
+ "ShowAlwaysContextMenuOnLinks",
+ base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc b/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/third_party/blink/common/features_h/Add-setting-to-invert-tap-and-long-tap.inc
@@ -0,0 +1 @@
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kShowAlwaysContextMenuOnLinks);
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc
--- a/third_party/blink/renderer/core/html/html_anchor_element.cc
+++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
Expand Down
Loading

0 comments on commit 49a7e0f

Please sign in to comment.