add-flag-to-stack-tabs.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Add --enable-stacked-tab-strip and --enable-tab-adjust-layout flags to tweak tab strip behavior
  2. --- a/chrome/browser/about_flags.cc
  3. +++ b/chrome/browser/about_flags.cc
  4. @@ -1752,6 +1752,10 @@ const FeatureEntry::Choice kWebOtpBacken
  5. //
  6. // When adding a new choice, add it to the end of the list.
  7. const FeatureEntry kFeatureEntries[] = {
  8. + {"enable-stacked-tab-strip",
  9. + "Enable stacking in tab strip",
  10. + "Forces tabs to be stacked in the tab strip. Otherwise, they follow default behavior.",
  11. + kOsAll, SINGLE_VALUE_TYPE("enable-stacked-tab-strip")},
  12. {"ignore-gpu-blacklist", flag_descriptions::kIgnoreGpuBlacklistName,
  13. flag_descriptions::kIgnoreGpuBlacklistDescription, kOsAll,
  14. SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)},
  15. --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
  16. +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
  17. @@ -76,14 +76,13 @@ using content::WebContents;
  18. namespace {
  19. bool DetermineTabStripLayoutStacked(PrefService* prefs, bool* adjust_layout) {
  20. - *adjust_layout = false;
  21. - // For ash, always allow entering stacked mode.
  22. #if defined(OS_CHROMEOS)
  23. *adjust_layout = true;
  24. return prefs->GetBoolean(prefs::kTabStripStackedLayout);
  25. #else
  26. - return base::CommandLine::ForCurrentProcess()->HasSwitch(
  27. - switches::kForceStackedTabStripLayout);
  28. + *adjust_layout = base::CommandLine::ForCurrentProcess()->HasSwitch("enable-tab-adjust-layout");
  29. + return prefs->GetBoolean(prefs::kTabStripStackedLayout) ||
  30. + base::CommandLine::ForCurrentProcess()->HasSwitch("enable-stacked-tab-strip");
  31. #endif
  32. }