Browse Source

Add patch for Bookmark-Bar on New-Tab-Page

toluschr 3 years ago
parent
commit
06be4c0d51

+ 1 - 1
patches/extra/bromite/fingerprinting-flags-client-rects-and-measuretext.patch

@@ -27,7 +27,7 @@
  #include "ui/accessibility/accessibility_features.h"
  #include "ui/accessibility/accessibility_switches.h"
  #include "ui/base/ui_base_features.h"
-@@ -1811,6 +1812,14 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -1818,6 +1819,14 @@ const FeatureEntry kFeatureEntries[] = {
       "Set internal PDF plugin name",
       "Sets the internal PDF viewer plugin name. Useful for sites that probe JS API navigator.plugins",
       kOsDesktop, MULTI_VALUE_TYPE(kPDFPluginNameChoices)},

+ 1 - 1
patches/extra/bromite/flag-fingerprinting-canvas-image-data-noise.patch

@@ -23,7 +23,7 @@ approach to change color components.
 
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -1825,6 +1825,10 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -1832,6 +1832,10 @@ const FeatureEntry kFeatureEntries[] = {
       "Enable Canvas::measureText() fingerprint deception",
       "Scale the output values of Canvas::measureText() with a randomly selected factor in the range -0.0003% to 0.0003%, which are recomputed on every document initialization.",
       kOsAll, SINGLE_VALUE_TYPE(switches::kFingerprintingCanvasMeasureTextNoise)},

+ 2 - 2
patches/extra/bromite/flag-max-connections-per-host.patch

@@ -27,7 +27,7 @@ with limited CPU/memory resources and it is disabled by default.
      "//components/offline_items_collection/core",
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -773,6 +773,11 @@ const FeatureEntry::Choice kForceEffecti
+@@ -780,6 +780,11 @@ const FeatureEntry::Choice kForceEffecti
       net::kEffectiveConnectionType4G},
  };
  
@@ -39,7 +39,7 @@ with limited CPU/memory resources and it is disabled by default.
  // 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 ==
-@@ -2770,6 +2775,9 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2783,6 +2788,9 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kAutofillCreditCardUploadDescription, kOsAll,
       FEATURE_VALUE_TYPE(autofill::features::kAutofillUpstream)},
  #endif  // TOOLKIT_VIEWS || OS_ANDROID

+ 53 - 0
patches/extra/ungoogled-chromium/add-flag-for-bookmark-bar-ntp.patch

@@ -0,0 +1,53 @@
+--- a/chrome/browser/about_flags.cc
++++ b/chrome/browser/about_flags.cc
+@@ -288,6 +288,13 @@ const FeatureEntry::Choice kPDFPluginNam
+     {"Microsoft Edge", switches::kPDFPluginName, "edge"},
+ };
+ 
++const FeatureEntry::Choice kBookmarkBarNewTab[] = {
++    {flags_ui::kGenericExperimentChoiceDefault, "", ""},
++    {"Never",
++     "bookmark-bar-ntp",
++     "never"},
++};
++
+ const FeatureEntry::Choice kTouchEventFeatureDetectionChoices[] = {
+     {flags_ui::kGenericExperimentChoiceDisabled, "", ""},
+     {flags_ui::kGenericExperimentChoiceEnabled,
+@@ -2072,6 +2079,12 @@ const FeatureEntry kFeatureEntries[] = {
+     {"focus-mode", flag_descriptions::kFocusMode,
+      flag_descriptions::kFocusModeDescription, kOsDesktop,
+      FEATURE_VALUE_TYPE(features::kFocusMode)},
++
++    {"bookmark-bar-ntp",
++     "Bookmark Bar on New-Tab-Page",
++     "Disable the Bookmark Bar on the New-Tab-Page", kOsDesktop,
++     MULTI_VALUE_TYPE(kBookmarkBarNewTab)},
++
+     {"touch-events", flag_descriptions::kTouchEventsName,
+      flag_descriptions::kTouchEventsDescription, kOsDesktop,
+      MULTI_VALUE_TYPE(kTouchEventFeatureDetectionChoices)},
+--- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
++++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
+@@ -4,6 +4,7 @@
+ 
+ #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
+ 
++#include "base/command_line.h"
+ #include "base/observer_list.h"
+ #include "build/build_config.h"
+ #include "chrome/browser/bookmarks/bookmark_model_factory.h"
+@@ -71,10 +72,12 @@ bool BookmarkTabHelper::ShouldShowBookma
+       !prefs->GetBoolean(bookmarks::prefs::kShowBookmarkBar))
+     return false;
+ 
++  const std::string flag_value =
++    base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("bookmark-bar-ntp");
+   // The bookmark bar is only shown on the NTP if the user
+   // has added something to it.
+   return IsNTP(web_contents()) && bookmark_model_ &&
+-         bookmark_model_->HasBookmarks();
++         bookmark_model_->HasBookmarks() && (flag_value != "never");
+ }
+ 
+ void BookmarkTabHelper::AddObserver(BookmarkTabHelperObserver* observer) {

+ 1 - 0
patches/series

@@ -81,6 +81,7 @@ extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch
 extra/ungoogled-chromium/enable-paste-and-go-new-tab-button.patch
 extra/ungoogled-chromium/enable-checkbox-external-protocol.patch
 extra/ungoogled-chromium/add-flag-for-pdf-plugin-name.patch
+extra/ungoogled-chromium/add-flag-for-bookmark-bar-ntp.patch
 extra/bromite/fingerprinting-flags-client-rects-and-measuretext.patch
 extra/bromite/flag-max-connections-per-host.patch
 extra/bromite/flag-fingerprinting-canvas-image-data-noise.patch