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

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

Issue 10836349: CSS Media Query now reports touch-support accurately for Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Moved IsTouchDevicePresent to ui::base Created 8 years, 4 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.cc
diff --git a/ui/base/touch/touch_device.cc b/ui/base/touch/touch_device.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1967a2e8a18fb51107017e689d4fa5a5849d20a7
--- /dev/null
+++ b/ui/base/touch/touch_device.cc
@@ -0,0 +1,19 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/base/touch/touch_device.h"
+#include "base/win/windows_version.h"
sky 2012/08/23 22:54:34 nit: newline between 5/6 and 6/7
girard 2012/08/24 14:30:12 Done.
+#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