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

Unified Diff: ui/base/touch/touch_device_win.cc

Issue 10915175: CSS Media Query now reports touch-support accurately for Windows (retry) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Turfing out copyright headers. Created 8 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: ui/base/touch/touch_device_win.cc
diff --git a/ui/base/touch/touch_device_win.cc b/ui/base/touch/touch_device_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cfcd4b7681f5651a0e28d5fa27cde701833e294d
--- /dev/null
+++ b/ui/base/touch/touch_device_win.cc
@@ -0,0 +1,15 @@
+#include "ui/base/touch/touch_device_win.h"
+#include "base/win/windows_version.h"
+#include <windows.h>
+
+namespace ui {
+namespace base {
+
+bool IsTouchDevicePresent() {
+ // Docs: http://msdn.microsoft.com/en-us/library/dd371581(VS.85).aspx
+ return (::base::win::GetVersion() >= ::base::win::VERSION_WIN7) &&
+ (::GetSystemMetrics(SM_DIGITIZER) > 0);
+}
+
+} // namespace base
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698