CSS Media Query now reports touch-support accurately for Windows (retry)
This patch was LGTM'ed as https://chromiumcodereview.appspot.com/10836349/
and submitted through the CQ, but was later reverted. Re-patching.
BUG=143792
Review URL: https://chromiumcodereview.appspot.com/10915175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156091 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c8f3746..8564c3a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -71,6 +71,7 @@
#include "net/url_request/url_request_context_getter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "ui/base/layout.h"
+#include "ui/base/touch/touch_device_win.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -527,12 +528,13 @@
command_line.HasSwitch(switches::kEnableCssShaders);
prefs.css_variables_enabled =
command_line.HasSwitch(switches::kEnableCssVariables);
- prefs.device_supports_touch =
- ui::GetDisplayLayout() == ui::LAYOUT_TOUCH;
#if defined(USE_AURA) && defined(USE_X11)
prefs.device_supports_touch |=
ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
#endif
+#if defined(OS_WIN)
+ prefs.device_supports_touch = ui::IsTouchDevicePresent();
+#endif
#if defined(OS_ANDROID)
prefs.device_supports_mouse = false;
#endif