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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 617543002: Disable overscroll on Windows machines w/o touchscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 3b53e5844f1548ed984d2a1bfb7e6bc31a18fa66..d3b75b36ce83308f435fd89041dff8d12494d8bc 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -41,6 +41,8 @@
#include "net/base/mime_util.h"
#include "net/base/net_util.h"
#include "skia/ext/platform_canvas.h"
+#include "ui/base/touch/touch_device.h"
+#include "ui/base/touch/touch_enabled.h"
#include "url/url_constants.h"
namespace content {
@@ -519,6 +521,23 @@ void NavigationControllerImpl::TakeScreenshot() {
screenshot_manager_->TakeScreenshot();
}
+bool NavigationControllerImpl::ShouldTakeScreenshotOnNavigation() {
+ if (!delegate_->CanOverscrollContent())
+ return false;
+
+ // Don't take screenshots on navigation on Windows and Unix 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 unnecessarily.
+#if defined(OS_BSD) || defined(OS_FREEBSD) || defined(OS_LINUX) \
+ || defined(OS_OPENBSD) || defined(OS_POSIX) || defined(OS_QNX) \
+ || defined(OS_WIN)
+ return ui::IsTouchDevicePresent() && ui::AreTouchEventsEnabled();
+#else
+ return true;
+#endif
+}
+
void NavigationControllerImpl::SetScreenshotManager(
NavigationEntryScreenshotManager* manager) {
screenshot_manager_.reset(manager ? manager :

Powered by Google App Engine
This is Rietveld 408576698