Commit c3c754b8 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

Do not cycle through tabs if the user uses the scroll wheel while hovering over the window border

BUG=366310
TEST=Manual, see bug

Review URL: https://codereview.chromium.org/285503002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269998 0039d316-1c4b-4281-b951-d872f2087c98
parent dd1e1ace
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "chrome/browser/ui/views/touch_uma/touch_uma.h" #include "chrome/browser/ui/views/touch_uma/touch_uma.h"
#include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/hit_test.h"
// static // static
const char BrowserRootView::kViewClassName[] = const char BrowserRootView::kViewClassName[] =
...@@ -124,9 +125,11 @@ bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) { ...@@ -124,9 +125,11 @@ bool BrowserRootView::OnMouseWheel(const ui::MouseWheelEvent& event) {
// Switch to the left/right tab if the wheel-scroll happens over the // Switch to the left/right tab if the wheel-scroll happens over the
// tabstrip, or the empty space beside the tabstrip. // tabstrip, or the empty space beside the tabstrip.
views::View* hit_view = GetEventHandlerForPoint(event.location()); views::View* hit_view = GetEventHandlerForPoint(event.location());
views::NonClientView* non_client = GetWidget()->non_client_view(); int hittest =
GetWidget()->non_client_view()->NonClientHitTest(event.location());
if (tabstrip()->Contains(hit_view) || if (tabstrip()->Contains(hit_view) ||
hit_view == non_client->frame_view()) { hittest == HTCAPTION ||
hittest == HTTOP) {
int scroll_offset = abs(event.y_offset()) > abs(event.x_offset()) ? int scroll_offset = abs(event.y_offset()) > abs(event.x_offset()) ?
event.y_offset() : -event.x_offset(); event.y_offset() : -event.x_offset();
Browser* browser = browser_view_->browser(); Browser* browser = browser_view_->browser();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment