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

Unified Diff: base/win/win_util.cc

Issue 10909206: Add tablet heuristic detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « base/win/win_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/win/win_util.cc
===================================================================
--- base/win/win_util.cc (revision 156164)
+++ base/win/win_util.cc (working copy)
@@ -214,6 +214,16 @@
return g_crash_on_process_detach;
}
+bool IsMachineATablet() {
+ if (base::win::GetVersion() < base::win::VERSION_WIN7)
+ return false;
+ // TODO(ananta): Add keyboard detection logic if it can be made reliable.
+ const int kPenInput = NID_INTEGRATED_PEN | NID_EXTERNAL_PEN;
+ const int kMultiTouch = NID_INTEGRATED_TOUCH | NID_MULTI_INPUT | NID_READY;
+ int sm = GetSystemMetrics(SM_DIGITIZER);
+ return ((sm & kMultiTouch) == kMultiTouch) && ((sm & kPenInput) == 0);
+}
+
} // namespace win
} // namespace base
« no previous file with comments | « base/win/win_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698