Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index 63c0e8c8fe2c1c5fe51228ad5318f7b250ad5e9d..3d7d9b3a6898bdee755630abed313809e7f6ce5b 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -191,6 +191,7 @@ |
| #include "net/url_request/url_request_context.h" |
| #include "third_party/WebKit/public/web/WebWindowFeatures.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "ui/base/touch/touch_device.h" |
|
sadrul
2014/09/30 16:32:15
Add this include below for OS_WIN in line ~200?
mfomitchev
2014/09/30 18:30:33
Done.
|
| #include "ui/base/window_open_disposition.h" |
| #include "ui/gfx/point.h" |
| #include "ui/shell_dialogs/selected_file_info.h" |
| @@ -1127,7 +1128,22 @@ void Browser::TabStripEmpty() { |
| } |
| bool Browser::CanOverscrollContent() const { |
| -#if defined(USE_AURA) |
| +#if defined(USE_AURA) && defined(OS_WIN) |
| + // Don't enable overscroll on Windows machines unless they have a touch |
| + // screen as these machines typically don't have a touchpad capable of |
| + // horizontal scrolling. We are purposefully biased towards "no" here, |
| + // so that we don't waste resources capturing screenshots for horizontal |
| + // overscroll navigation unnecessarily. |
| + bool allowOverscroll = ui::IsTouchDevicePresent(); |
|
sadrul
2014/09/30 16:32:15
allow_overscroll
Also, AURA is always turned on f
mfomitchev
2014/09/30 18:30:33
Done.
|
| +#elif defined(USE_AURA) |
| + bool allowOverscroll = true; |
| +#else |
| + bool allowOverscroll = false; |
| +#endif |
| + |
| + if (!allowOverscroll) |
| + return false; |
| + |
| const std::string value = CommandLine::ForCurrentProcess()-> |
| GetSwitchValueASCII(switches::kOverscrollHistoryNavigation); |
| bool overscroll_enabled = value != "0"; |
| @@ -1143,9 +1159,6 @@ bool Browser::CanOverscrollContent() const { |
| if (value == "1" && bookmark_bar_state_ == BookmarkBar::DETACHED) |
| return false; |
| return true; |
| -#else |
| - return false; |
| -#endif |
| } |
| bool Browser::ShouldPreserveAbortedURLs(WebContents* source) { |