Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / common / content_switches_internal.cc
index b148772..28542e4 100644 (file)
@@ -7,6 +7,10 @@
 #include "base/command_line.h"
 #include "content/public/common/content_switches.h"
 
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
 namespace content {
 
 bool IsOverlayScrollbarEnabled() {
@@ -20,4 +24,21 @@ bool IsOverlayScrollbarEnabled() {
   return false;
 }
 
+bool IsPinchToZoomEnabled() {
+  const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+  // --disable-pinch should always disable pinch
+  if (command_line.HasSwitch(switches::kDisablePinch))
+    return false;
+
+#if defined(OS_WIN)
+  return base::win::GetVersion() >= base::win::VERSION_WIN8;
+#elif defined(OS_CHROMEOS)
+  return true;
+#endif
+
+  return command_line.HasSwitch(switches::kEnableViewport) ||
+      command_line.HasSwitch(switches::kEnablePinch);
+}
+
 } // namespace content