Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 63c0e8c8fe2c1c5fe51228ad5318f7b250ad5e9d..1746ade6d2ae48fc91084da9b29fd1722b4b21f6 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -201,6 +201,7 @@ |
#include "chrome/browser/task_manager/task_manager.h" |
#include "chrome/browser/ui/view_ids.h" |
#include "components/autofill/core/browser/autofill_ie_toolbar_import_win.h" |
+#include "ui/base/touch/touch_device.h" |
#include "ui/base/win/shell.h" |
#endif // OS_WIN |
@@ -1128,6 +1129,23 @@ void Browser::TabStripEmpty() { |
bool Browser::CanOverscrollContent() const { |
#if defined(USE_AURA) |
sky
2014/09/30 21:46:05
Oy, this is hard to read with all the ifdefs. How
mfomitchev
2014/09/30 22:32:29
Hmm.. how can I put the win implementation into br
|
+#if 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 allow_overscroll = ui::IsTouchDevicePresent(); |
+#else |
+ bool allow_overscroll = true; |
+#endif |
+#else |
+ bool allow_overscroll = false; |
+#endif |
+ |
+ if (!allow_overscroll) |
+ return false; |
+ |
const std::string value = CommandLine::ForCurrentProcess()-> |
GetSwitchValueASCII(switches::kOverscrollHistoryNavigation); |
bool overscroll_enabled = value != "0"; |
@@ -1143,9 +1161,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) { |