summaryrefslogtreecommitdiffstats
path: root/base/win
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-18 23:27:47 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-18 23:27:47 +0000
commite152ebde18269e5e35223a526c776bc2d74f5561 (patch)
tree08998145919d80b3ee2a1ae5a6375387ac401e08 /base/win
parent87a4b990583c80a24b2122662beebc63e7b96451 (diff)
downloadchromium_src-e152ebde18269e5e35223a526c776bc2d74f5561.zip
chromium_src-e152ebde18269e5e35223a526c776bc2d74f5561.tar.gz
chromium_src-e152ebde18269e5e35223a526c776bc2d74f5561.tar.bz2
We should enable touch mode in chrome metro mode on Windows 8 only if the screen supports
integrated touch. BUG=132362 R=cpu Review URL: https://chromiumcodereview.appspot.com/10532176 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/win')
-rw-r--r--base/win/metro.cc6
-rw-r--r--base/win/metro.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/base/win/metro.cc b/base/win/metro.cc
index 46476c8..3ee67f5 100644
--- a/base/win/metro.cc
+++ b/base/win/metro.cc
@@ -77,5 +77,11 @@ wchar_t* LocalAllocAndCopyString(const string16& src) {
return dest;
}
+bool IsTouchEnabled() {
+ int value = GetSystemMetrics(SM_DIGITIZER);
+ return value & (NID_READY | NID_INTEGRATED_TOUCH) ==
+ (NID_READY | NID_INTEGRATED_TOUCH);
+}
+
} // namespace win
} // namespace base
diff --git a/base/win/metro.h b/base/win/metro.h
index e25c6f4..cce8d3a 100644
--- a/base/win/metro.h
+++ b/base/win/metro.h
@@ -59,6 +59,9 @@ BASE_EXPORT bool IsMetroProcess();
// copying the src to it.
BASE_EXPORT wchar_t* LocalAllocAndCopyString(const string16& src);
+// Returns true if the screen supports touch.
+BASE_EXPORT bool IsTouchEnabled();
+
} // namespace win
} // namespace base