diff options
Diffstat (limited to 'base/win')
-rw-r--r-- | base/win/win_util.cc | 11 | ||||
-rw-r--r-- | base/win/win_util.h | 6 |
2 files changed, 5 insertions, 12 deletions
diff --git a/base/win/win_util.cc b/base/win/win_util.cc index acdc907..3d12f77 100644 --- a/base/win/win_util.cc +++ b/base/win/win_util.cc @@ -214,20 +214,13 @@ void SetAbortBehaviorForCrashReporting() { signal(SIGABRT, ForceCrashOnSigAbort); } -bool IsMachineATablet() { +bool IsTouchEnabledDevice() { if (base::win::GetVersion() < base::win::VERSION_WIN7) return false; const int kMultiTouch = NID_INTEGRATED_TOUCH | NID_MULTI_INPUT | NID_READY; - const int kMaxTabletScreenWidth = 1366; - const int kMaxTabletScreenHeight = 768; int sm = GetSystemMetrics(SM_DIGITIZER); if ((sm & kMultiTouch) == kMultiTouch) { - int cx = GetSystemMetrics(SM_CXSCREEN); - int cy = GetSystemMetrics(SM_CYSCREEN); - // Handle landscape and portrait modes. - return cx > cy ? - (cx <= kMaxTabletScreenWidth && cy <= kMaxTabletScreenHeight) : - (cy <= kMaxTabletScreenWidth && cx <= kMaxTabletScreenHeight); + return true; } return false; } diff --git a/base/win/win_util.h b/base/win/win_util.h index 0404ef0..78390be0 100644 --- a/base/win/win_util.h +++ b/base/win/win_util.h @@ -102,9 +102,9 @@ BASE_EXPORT bool ShouldCrashOnProcessDetach(); // process is aborted. BASE_EXPORT void SetAbortBehaviorForCrashReporting(); -// A tablet by this definition is something that has integrated multi-touch -// ready to use and also has screen resolution not greater than 1366x768. -BASE_EXPORT bool IsMachineATablet(); +// A touch enabled device by this definition is something that has +// integrated multi-touch ready to use and has Windows version > Windows7. +BASE_EXPORT bool IsTouchEnabledDevice(); // Get the size of a struct up to and including the specified member. // This is necessary to set compatible struct sizes for different versions |