diff options
author | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 19:16:16 +0000 |
---|---|---|
committer | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 19:16:16 +0000 |
commit | 25ee94f33700d5adbf5fcea30497cb21acaa5ac9 (patch) | |
tree | 3c5f4b4e585ac70e6c7d5d9b4402b3c20ea545d3 /ui | |
parent | 3e076a8cc7a0f858b6ba3f563fca6716f889e1fe (diff) | |
download | chromium_src-25ee94f33700d5adbf5fcea30497cb21acaa5ac9.zip chromium_src-25ee94f33700d5adbf5fcea30497cb21acaa5ac9.tar.gz chromium_src-25ee94f33700d5adbf5fcea30497cb21acaa5ac9.tar.bz2 |
CSS Media Query now reports touch-support accurately for Windows (retry)
This patch was LGTM'ed as https://chromiumcodereview.appspot.com/10836349/
and submitted through the CQ, but was later reverted. Re-patching.
BUG=143792
Review URL: https://chromiumcodereview.appspot.com/10915175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/base/touch/touch_device_win.cc | 17 | ||||
-rw-r--r-- | ui/base/touch/touch_device_win.h | 17 | ||||
-rw-r--r-- | ui/base/touch/touch_factory.h | 2 | ||||
-rw-r--r-- | ui/ui.gyp | 2 |
4 files changed, 37 insertions, 1 deletions
diff --git a/ui/base/touch/touch_device_win.cc b/ui/base/touch/touch_device_win.cc new file mode 100644 index 0000000..0a00251 --- /dev/null +++ b/ui/base/touch/touch_device_win.cc @@ -0,0 +1,17 @@ +// 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_win.h" +#include "base/win/windows_version.h" +#include <windows.h> + +namespace ui { + +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 ui diff --git a/ui/base/touch/touch_device_win.h b/ui/base/touch/touch_device_win.h new file mode 100644 index 0000000..8cc4b7d --- /dev/null +++ b/ui/base/touch/touch_device_win.h @@ -0,0 +1,17 @@ +// 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. + +#ifndef UI_BASE_TOUCH_TOUCH_DEVICE_H_ +#define UI_BASE_TOUCH_TOUCH_DEVICE_H_ + +#include "ui/base/ui_export.h" + +namespace ui { + +// Returns true if a touch device is available. +UI_EXPORT bool IsTouchDevicePresent(); + +} // namespace ui + +#endif // UI_BASE_TOUCH_TOUCH_DEVICE_H_ diff --git a/ui/base/touch/touch_factory.h b/ui/base/touch/touch_factory.h index 1f19bede..c95cfc8 100644 --- a/ui/base/touch/touch_factory.h +++ b/ui/base/touch/touch_factory.h @@ -98,7 +98,7 @@ class UI_EXPORT TouchFactory { SetCursorVisible(false, false); } - // Requirement for Signleton + // Requirement for Singleton friend struct DefaultSingletonTraits<TouchFactory>; // The default cursor is hidden after startup, and when the mouse pointer is @@ -641,6 +641,8 @@ 'gfx/icon_util.h', 'base/native_theme/native_theme_win.cc', 'base/native_theme/native_theme_win.h', + 'base/touch/touch_device_win.cc', + 'base/touch/touch_device_win.h', ], 'sources!': [ 'base/touch/touch_factory.cc', |