Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: chrome/browser/ui/browser.cc

Issue 617543002: Disable overscroll on Windows machines w/o touchscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing feedback. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698