add-flag-for-bookmark-bar-ntp.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
  2. +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
  3. @@ -4,6 +4,7 @@
  4. #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h"
  5. +#include "base/command_line.h"
  6. #include "base/observer_list.h"
  7. #include "build/build_config.h"
  8. #include "build/chromeos_buildflags.h"
  9. @@ -70,10 +71,12 @@ bool BookmarkTabHelper::ShouldShowBookma
  10. !prefs->GetBoolean(bookmarks::prefs::kShowBookmarkBar))
  11. return false;
  12. + const std::string flag_value =
  13. + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("bookmark-bar-ntp");
  14. // The bookmark bar is only shown on the NTP if the user
  15. // has added something to it.
  16. return IsNTP(web_contents()) && bookmark_model_ &&
  17. - bookmark_model_->HasBookmarks();
  18. + bookmark_model_->HasBookmarks() && (flag_value != "never");
  19. }
  20. void BookmarkTabHelper::AddObserver(BookmarkTabHelperObserver* observer) {
  21. --- a/chrome/browser/ungoogled_flag_choices.h
  22. +++ b/chrome/browser/ungoogled_flag_choices.h
  23. @@ -34,4 +34,10 @@ const FeatureEntry::Choice kScrollEventC
  24. "scroll-tabs",
  25. "never"}
  26. };
  27. +const FeatureEntry::Choice kBookmarkBarNewTab[] = {
  28. + {flags_ui::kGenericExperimentChoiceDefault, "", ""},
  29. + {"Never",
  30. + "bookmark-bar-ntp",
  31. + "never"},
  32. +};
  33. #endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_
  34. --- a/chrome/browser/ungoogled_flag_entries.h
  35. +++ b/chrome/browser/ungoogled_flag_entries.h
  36. @@ -36,4 +36,8 @@
  37. "Scroll switches tab",
  38. "Switch to the left/right tab if the wheel-scroll happens over the tabstrip, or the empty space beside the tabstrip. ungoogled-chromium flag.",
  39. kOsDesktop, MULTI_VALUE_TYPE(kScrollEventChangesTab)},
  40. + {"bookmark-bar-ntp",
  41. + "Bookmark Bar on New-Tab-Page",
  42. + "Disable the Bookmark Bar on the New-Tab-Page. ungoogled-chromium flag.",
  43. + kOsDesktop, MULTI_VALUE_TYPE(kBookmarkBarNewTab)},
  44. #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_