MouseLock compile and run time flags.
authorscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 19:59:14 +0000 (19:59 +0000)
committerscheib@chromium.org <scheib@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Oct 2011 19:59:14 +0000 (19:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70530

Reviewed by Darin Fisher.

Source/JavaScriptCore:

* wtf/Platform.h:

Source/WebCore:

No new tests.

* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webkitMouseLockAPIEnabled):
(WebCore::RuntimeEnabledFeatures::setWebkitMouseLockAPIEnabled):
(WebCore::RuntimeEnabledFeatures::webkitLockMouseEnabled):
(WebCore::RuntimeEnabledFeatures::webkitUnlockMouseEnabled):
(WebCore::RuntimeEnabledFeatures::webkitMouseLockedEnabled):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setMouseLockEnabled):
(WebCore::Settings::mouseLockEnabled):

Source/WebKit/chromium:

* features.gypi:
* public/WebRuntimeFeatures.h:
* public/WebSettings.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableMouseLockAPI):
(WebKit::WebRuntimeFeatures::isMouseLockAPIEnabled):
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setMouseLockEnabled):
* src/WebSettingsImpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98016 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/chromium/public/WebRuntimeFeatures.h
Source/WebKit/chromium/public/WebSettings.h
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
Source/WebKit/chromium/src/WebSettingsImpl.cpp
Source/WebKit/chromium/src/WebSettingsImpl.h

index 62b055c..9f60619 100644 (file)
@@ -1,3 +1,12 @@
+2011-10-20  Vincent Scheib  <scheib@chromium.org>
+
+        MouseLock compile and run time flags.
+        https://bugs.webkit.org/show_bug.cgi?id=70530
+
+        Reviewed by Darin Fisher.
+
+        * wtf/Platform.h:
+
 2011-10-20  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Rename static deleteProperty to deletePropertyByIndex
index fc76723..4031f05 100644 (file)
 #define ENABLE_FULLSCREEN_API 0
 #endif
 
+#if !defined(ENABLE_MOUSE_LOCK_API)
+#define ENABLE_MOUSE_LOCK_API 0
+#endif
+
 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64)
 #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
     || (CPU(IA64) && !CPU(IA64_32)) \
index 977bfd3..3163353 100755 (executable)
@@ -1,3 +1,25 @@
+2011-10-20  Vincent Scheib  <scheib@chromium.org>
+
+        MouseLock compile and run time flags.
+        https://bugs.webkit.org/show_bug.cgi?id=70530
+
+        Reviewed by Darin Fisher.
+
+        No new tests.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::webkitMouseLockAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::setWebkitMouseLockAPIEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitLockMouseEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitUnlockMouseEnabled):
+        (WebCore::RuntimeEnabledFeatures::webkitMouseLockedEnabled):
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setMouseLockEnabled):
+        (WebCore::Settings::mouseLockEnabled):
+
 2011-10-20  Tony Chang  <tony@chromium.org>
 
         Fix a compiler warning in MediaStreamTrack.cpp:
index 85fae83..4abea05 100644 (file)
@@ -155,6 +155,10 @@ bool RuntimeEnabledFeatures::isQuotaEnabled = false;
 bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true;
 #endif
 
+#if ENABLE(MOUSE_LOCK_API)
+bool RuntimeEnabledFeatures::isMouseLockAPIEnabled = false;
+#endif
+
 #if ENABLE(MEDIA_SOURCE)
 bool RuntimeEnabledFeatures::isMediaSourceEnabled = false;
 #endif
index 6097a98..6624c7a 100644 (file)
@@ -80,6 +80,14 @@ public:
     static bool webkitCancelFullScreenEnabled() { return isFullScreenAPIEnabled; }
 #endif
 
+#if ENABLE(MOUSE_LOCK_API)
+    static bool webkitMouseLockAPIEnabled() { return isMouseLockAPIEnabled; }
+    static void setWebkitMouseLockAPIEnabled(bool isEnabled) { isMouseLockAPIEnabled = isEnabled; }
+    static bool webkitLockMouseEnabled() { return isMouseLockAPIEnabled; }
+    static bool webkitUnlockMouseEnabled() { return isMouseLockAPIEnabled; }
+    static bool webkitMouseLockedEnabled() { return isMouseLockAPIEnabled; }
+#endif
+
 #if ENABLE(VIDEO)
     static bool audioEnabled();
     static bool htmlMediaElementEnabled();
@@ -218,6 +226,10 @@ private:
     static bool isFullScreenAPIEnabled;
 #endif
 
+#if ENABLE(MOUSE_LOCK_API)
+    static bool isMouseLockAPIEnabled;
+#endif
+
 #if ENABLE(MEDIA_SOURCE)
     static bool isMediaSourceEnabled;
 #endif
index c53413e..9f2095d 100644 (file)
@@ -195,6 +195,9 @@ Settings::Settings(Page* page)
 #if ENABLE(FULLSCREEN_API)
     , m_fullScreenAPIEnabled(false)
 #endif
+#if ENABLE(MOUSE_LOCK_API)
+    , m_mouseLockAPIEnabled(false)
+#endif
     , m_asynchronousSpellCheckingEnabled(false)
 #if USE(UNIFIED_TEXT_CHECKING)
     , m_unifiedTextCheckerEnabled(true)
index 1073b41..dc5c1c3 100644 (file)
@@ -373,6 +373,11 @@ namespace WebCore {
         bool fullScreenEnabled() const  { return m_fullScreenAPIEnabled; }
 #endif
 
+#if ENABLE(MOUSE_LOCK_API)
+        void setMouseLockEnabled(bool flag) { m_mouseLockAPIEnabled = flag; }
+        bool mouseLockEnabled() const  { return m_mouseLockAPIEnabled; }
+#endif
+
 #if USE(AVFOUNDATION)
         static void setAVFoundationEnabled(bool flag) { gAVFoundationEnabled = flag; }
         static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
@@ -570,6 +575,9 @@ namespace WebCore {
 #if ENABLE(FULLSCREEN_API)
         bool m_fullScreenAPIEnabled : 1;
 #endif
+#if ENABLE(MOUSE_LOCK_API)
+        bool m_mouseLockAPIEnabled : 1;
+#endif
         bool m_asynchronousSpellCheckingEnabled: 1;
         bool m_unifiedTextCheckerEnabled: 1;
         bool m_memoryInfoEnabled: 1;
index e465ad4..1160818 100644 (file)
@@ -1,3 +1,20 @@
+2011-10-20  Vincent Scheib  <scheib@chromium.org>
+
+        MouseLock compile and run time flags.
+        https://bugs.webkit.org/show_bug.cgi?id=70530
+
+        Reviewed by Darin Fisher.
+
+        * features.gypi:
+        * public/WebRuntimeFeatures.h:
+        * public/WebSettings.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableMouseLockAPI):
+        (WebKit::WebRuntimeFeatures::isMouseLockAPIEnabled):
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::setMouseLockEnabled):
+        * src/WebSettingsImpl.h:
+
 2011-10-20  Hao Zheng  <zhenghao@chromium.org>
 
         [Chromium] Reduce dependencies of ImageDiff to compile it for Android.
index 062d801..df4a69d 100644 (file)
@@ -68,6 +68,7 @@
       'ENABLE_METER_TAG=1',
       'ENABLE_MHTML=1',
       'ENABLE_MICRODATA=0',
+      'ENABLE_MOUSE_LOCK_API=1',
       'ENABLE_MUTATION_OBSERVERS=<(enable_mutation_observers)',
       'ENABLE_NOTIFICATIONS=1',
       'ENABLE_ORIENTATION_EVENTS=0',
index ba1c0dd..6c3d299 100644 (file)
@@ -109,6 +109,9 @@ public:
     WEBKIT_EXPORT static void enableFullScreenAPI(bool);
     WEBKIT_EXPORT static bool isFullScreenAPIEnabled();
 
+    WEBKIT_EXPORT static void enableMouseLockAPI(bool);
+    WEBKIT_EXPORT static bool isMouseLockAPIEnabled();
+
     WEBKIT_EXPORT static void enableMediaSource(bool);
     WEBKIT_EXPORT static bool isMediaSourceEnabled();
 
index 7eecd09..3aad228 100644 (file)
@@ -124,6 +124,7 @@ public:
     virtual void setValidationMessageTimerMagnification(int) = 0;
     virtual void setMinimumTimerInterval(double) = 0;
     virtual void setFullScreenEnabled(bool) = 0;
+    virtual void setMouseLockEnabled(bool) = 0;
     virtual void setAllowDisplayOfInsecureContent(bool) = 0;
     virtual void setAllowRunningOfInsecureContent(bool) = 0;
     virtual void setShouldPrintBackgrounds(bool) = 0;
index 0de6074..6b2833a 100644 (file)
@@ -360,6 +360,24 @@ bool WebRuntimeFeatures::isFullScreenAPIEnabled()
 #endif
 }
 
+void WebRuntimeFeatures::enableMouseLockAPI(bool enable)
+{
+#if ENABLE(MOUSE_LOCK_API)
+    RuntimeEnabledFeatures::setWebkitMouseLockAPIEnabled(enable);
+#else
+    UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isMouseLockAPIEnabled()
+{
+#if ENABLE(MOUSE_LOCK_API)
+    return RuntimeEnabledFeatures::webkitMouseLockAPIEnabled();
+#else
+    return false;
+#endif
+}
+
 void WebRuntimeFeatures::enableMediaSource(bool enable)
 {
 #if ENABLE(MEDIA_SOURCE)
index 116423c..f2fb379 100644 (file)
@@ -413,6 +413,15 @@ void WebSettingsImpl::setFullScreenEnabled(bool enabled)
 #endif
 }
 
+void WebSettingsImpl::setMouseLockEnabled(bool enabled)
+{
+#if ENABLE(MOUSE_LOCK_API)
+    m_settings->setMouseLockEnabled(enabled);
+#else
+    UNUSED_PARAM(enabled);
+#endif
+}
+
 void WebSettingsImpl::setAllowDisplayOfInsecureContent(bool enabled)
 {
     m_settings->setAllowDisplayOfInsecureContent(enabled);
index 8ab97f3..2900864 100644 (file)
@@ -116,6 +116,7 @@ public:
     virtual void setValidationMessageTimerMagnification(int);
     virtual void setMinimumTimerInterval(double);
     virtual void setFullScreenEnabled(bool);
+    virtual void setMouseLockEnabled(bool);
     virtual void setAllowDisplayOfInsecureContent(bool);
     virtual void setAllowRunningOfInsecureContent(bool);
     virtual void setShouldPrintBackgrounds(bool);