diff options
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch')
| -rw-r--r-- | www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch deleted file mode 100644 index d657480..0000000 --- a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-scroll-tabs.patch +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 1 | --- chrome/browser/ui/views/frame/browser_root_view.cc.orig | ||
| 2 | +++ chrome/browser/ui/views/frame/browser_root_view.cc | ||
| 3 | @@ -11,6 +11,7 @@ | ||
| 4 | |||
| 5 | #include "base/bind.h" | ||
| 6 | #include "base/callback_helpers.h" | ||
| 7 | +#include "base/command_line.h" | ||
| 8 | #include "base/metrics/user_metrics.h" | ||
| 9 | #include "base/task/post_task.h" | ||
| 10 | #include "base/task/thread_pool.h" | ||
| 11 | @@ -109,6 +110,18 @@ DragOperation GetDropEffect(const ui::Dr | ||
| 12 | return DragOperation::kMove; | ||
| 13 | } | ||
| 14 | |||
| 15 | +bool ShouldScrollChangesTab() { | ||
| 16 | + const std::string flag_value = | ||
| 17 | + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("scroll-tabs"); | ||
| 18 | + | ||
| 19 | + if (flag_value == "always") | ||
| 20 | + return true; | ||
| 21 | + else if (flag_value == "never") | ||
| 22 | + return false; | ||
| 23 | + | ||
| 24 | + return browser_defaults::kScrollEventChangesTab; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | } // namespace | ||
| 28 | |||
| 29 | BrowserRootView::DropInfo::DropInfo() = default; | ||
| 30 | @@ -120,7 +133,9 @@ BrowserRootView::DropInfo::~DropInfo() { | ||
| 31 | |||
| 32 | BrowserRootView::BrowserRootView(BrowserView* browser_view, | ||
| 33 | views::Widget* widget) | ||
| 34 | - : views::internal::RootView(widget), browser_view_(browser_view) {} | ||
| 35 | + : views::internal::RootView(widget), browser_view_(browser_view) { | ||
| 36 | + scroll_event_changes_tab_ = ShouldScrollChangesTab(); | ||
| 37 | +} | ||
| 38 | |||
| 39 | BrowserRootView::~BrowserRootView() { | ||
| 40 | // It's possible to destroy the browser while a drop is active. In this case, | ||
| 41 | @@ -245,7 +260,7 @@ bool BrowserRootView::OnMouseWheel(const | ||
| 42 | |||
| 43 | // Scroll-event-changes-tab is incompatible with scrolling tabstrip, so | ||
| 44 | // disable it if the latter feature is enabled. | ||
| 45 | - if (browser_defaults::kScrollEventChangesTab && | ||
| 46 | + if (scroll_event_changes_tab_ && | ||
| 47 | !base::FeatureList::IsEnabled(features::kScrollableTabStrip)) { | ||
| 48 | // Switch to the left/right tab if the wheel-scroll happens over the | ||
| 49 | // tabstrip, or the empty space beside the tabstrip. | ||
| 50 | --- chrome/browser/ui/views/frame/browser_root_view.h.orig | ||
| 51 | +++ chrome/browser/ui/views/frame/browser_root_view.h | ||
| 52 | @@ -143,6 +143,8 @@ class BrowserRootView : public views::in | ||
| 53 | int scroll_remainder_x_ = 0; | ||
| 54 | int scroll_remainder_y_ = 0; | ||
| 55 | |||
| 56 | + bool scroll_event_changes_tab_ = false; | ||
| 57 | + | ||
| 58 | std::unique_ptr<DropInfo> drop_info_; | ||
| 59 | |||
| 60 | base::WeakPtrFactory<BrowserRootView> weak_ptr_factory_{this}; | ||
| 61 | --- chrome/browser/ungoogled_flag_choices.h.orig | ||
| 62 | +++ chrome/browser/ungoogled_flag_choices.h | ||
| 63 | @@ -25,4 +25,13 @@ const FeatureEntry::Choice kShowAvatarBu | ||
| 64 | "show-avatar-button", | ||
| 65 | "never"} | ||
| 66 | }; | ||
| 67 | +const FeatureEntry::Choice kScrollEventChangesTab[] = { | ||
| 68 | + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, | ||
| 69 | + {"Always", | ||
| 70 | + "scroll-tabs", | ||
| 71 | + "always"}, | ||
| 72 | + {"Never", | ||
| 73 | + "scroll-tabs", | ||
| 74 | + "never"} | ||
| 75 | +}; | ||
| 76 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_CHOICES_H_ | ||
| 77 | --- chrome/browser/ungoogled_flag_entries.h.orig | ||
| 78 | +++ chrome/browser/ungoogled_flag_entries.h | ||
| 79 | @@ -36,4 +36,8 @@ | ||
| 80 | "Hide crashed bubble", | ||
| 81 | "Hides the bubble box with the message \"Restore Pages? Chromium didn't shut down correctly.\" that shows on startup after the browser did not exit cleanly. ungoogled-chromium flag.", | ||
| 82 | kOsAll, SINGLE_VALUE_TYPE("hide-crashed-bubble")}, | ||
| 83 | + {"scroll-tabs", | ||
| 84 | + "Scroll switches tab", | ||
| 85 | + "Switch to the left/right tab if the wheel-scroll happens over the tabstrip, or the empty space beside the tabstrip. ungoogled-chromium flag.", | ||
| 86 | + kOsDesktop, MULTI_VALUE_TYPE(kScrollEventChangesTab)}, | ||
| 87 | #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_ | ||
