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