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

Unified Diff: content/browser/web_contents/web_contents_impl.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: Code cleaned up for review. 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index cee3043ec6c0f9d39b64d34c1fbab5f98f3d9b5f..0136d5f62e87ba5bde0d0aa28ce1b6f7f95eb2ca 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -15,6 +15,7 @@
#include "base/sys_info.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "base/win/windows_version.h"
#include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/debugger/devtools_manager_impl.h"
@@ -531,6 +532,11 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.device_supports_touch |=
ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
#endif
+#if defined(OS_WIN)
+ if (base::win::GetVersion() >= base::win::VERSION_WIN7)
+ // Docs: http://msdn.microsoft.com/en-us/library/dd371581(VS.85).aspx
girard 2012/08/20 21:15:18 Q: Is it reasonable to leave a documentation link
sky 2012/08/20 22:53:49 Yes.
+ prefs.device_supports_touch = (::GetSystemMetrics(SM_DIGITIZER) > 0);
girard 2012/08/20 21:15:18 Q: Would it be better to move this out to base::wi
sky 2012/08/20 22:53:49 That sounds better to me.
girard 2012/08/23 15:57:23 Done.
+#endif
#if defined(OS_ANDROID)
prefs.device_supports_mouse = false;
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698