mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e94168884 |
@@ -8,45 +8,49 @@
|
||||
#include "base/containers/adapters.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
@@ -177,6 +178,18 @@ DragOperation GetDropEffect(const ui::Dr
|
||||
@@ -177,6 +178,21 @@ DragOperation GetDropEffect(const ui::Dr
|
||||
return DragOperation::kMove;
|
||||
}
|
||||
|
||||
+bool ShouldScrollChangesTab() {
|
||||
+bool ShouldScrollChangesTab(BrowserView* browser_view) {
|
||||
+ const std::string flag_value =
|
||||
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("scroll-tabs");
|
||||
+
|
||||
+ if (flag_value == "always")
|
||||
+ if (flag_value == "always") {
|
||||
+ return true;
|
||||
+ else if (flag_value == "never")
|
||||
+ }
|
||||
+ if (flag_value == "never") {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return browser_defaults::kScrollEventChangesTab;
|
||||
+ return browser_defaults::kScrollEventChangesTab &&
|
||||
+ !browser_view->ShouldDrawVerticalTabStrip();
|
||||
+}
|
||||
+
|
||||
} // namespace
|
||||
|
||||
BrowserRootView::DropInfo::DropInfo() = default;
|
||||
@@ -189,7 +202,9 @@ BrowserRootView::DropInfo::~DropInfo() {
|
||||
@@ -189,7 +205,9 @@ BrowserRootView::DropInfo::~DropInfo() {
|
||||
|
||||
BrowserRootView::BrowserRootView(BrowserView* browser_view,
|
||||
views::Widget* widget)
|
||||
- : views::internal::RootView(widget), browser_view_(browser_view) {}
|
||||
+ : views::internal::RootView(widget), browser_view_(browser_view) {
|
||||
+ scroll_event_changes_tab_ = ShouldScrollChangesTab();
|
||||
+ scroll_event_changes_tab_ = ShouldScrollChangesTab(browser_view);
|
||||
+}
|
||||
|
||||
BrowserRootView::~BrowserRootView() {
|
||||
// It's possible to destroy the browser while a drop is active. In this case,
|
||||
@@ -331,7 +346,7 @@ bool BrowserRootView::OnMouseWheel(const
|
||||
@@ -331,8 +349,7 @@ bool BrowserRootView::OnMouseWheel(const
|
||||
|
||||
// Scroll-event-changes-tab is incompatible with vertical tabstrip, so
|
||||
// disable it if the latter feature is enabled.
|
||||
- if (browser_defaults::kScrollEventChangesTab &&
|
||||
+ if (scroll_event_changes_tab_ &&
|
||||
!browser_view_->ShouldDrawVerticalTabStrip()) {
|
||||
- !browser_view_->ShouldDrawVerticalTabStrip()) {
|
||||
+ if (scroll_event_changes_tab_) {
|
||||
// Switch to the left/right tab if the wheel-scroll happens over the
|
||||
// tabstrip, or the empty space beside the tabstrip.
|
||||
views::View* hit_view = GetEventHandlerForPoint(event.location());
|
||||
--- a/chrome/browser/ui/views/frame/browser_root_view.h
|
||||
+++ b/chrome/browser/ui/views/frame/browser_root_view.h
|
||||
@@ -158,6 +158,8 @@ class BrowserRootView : public views::in
|
||||
|
||||
Reference in New Issue
Block a user