| 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 :
|
|
|