Title: [137212] branches/chromium/1312/Source
Revision
137212
Author
ad...@chromium.org
Date
2012-12-10 15:06:42 -0800 (Mon, 10 Dec 2012)

Log Message

Merge 136785
> Add runtime enable for web intents.
> https://bugs.webkit.org/show_bug.cgi?id=103669
> 
> Patch by Greg Billock <gbill...@google.com> on 2012-12-05
> Reviewed by Adam Barth.
> 
> Source/WebCore:
> 
> Make web intents _javascript_ API enabled by a runtime setting.
> 
> * Modules/intents/DOMWindowIntents.idl:
> * Modules/intents/NavigatorIntents.idl:
> * bindings/generic/RuntimeEnabledFeatures.cpp:
> (WebCore):
> * bindings/generic/RuntimeEnabledFeatures.h:
> (RuntimeEnabledFeatures):
> (WebCore::RuntimeEnabledFeatures::webkitStartActivityEnabled):
> (WebCore::RuntimeEnabledFeatures::webkitIntentEnabled):
> (WebCore::RuntimeEnabledFeatures::webKitIntentEnabled):
> (WebCore::RuntimeEnabledFeatures::setWebIntentsEnabled):
> 
> Source/WebKit/chromium:
> 
> Propagate runtime setting to enable/disable web intents _javascript_ API.
> 
> * public/WebRuntimeFeatures.h:
> (WebRuntimeFeatures):
> * src/WebRuntimeFeatures.cpp:
> (WebKit::WebRuntimeFeatures::enableWebIntents):
> (WebKit):
> (WebKit::WebRuntimeFeatures::isWebIntentsEnabled):

TBR=commit-qu...@webkit.org
Review URL: https://codereview.chromium.org/11519009

Modified Paths

Diff

Modified: branches/chromium/1312/Source/WebCore/Modules/intents/DOMWindowIntents.idl (137211 => 137212)


--- branches/chromium/1312/Source/WebCore/Modules/intents/DOMWindowIntents.idl	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebCore/Modules/intents/DOMWindowIntents.idl	2012-12-10 23:06:42 UTC (rev 137212)
@@ -28,8 +28,8 @@
     Conditional=WEB_INTENTS,
     Supplemental=DOMWindow
 ] interface DOMWindowIntents {
-    attribute IntentConstructor WebKitIntent;
+    [V8EnabledAtRuntime] attribute IntentConstructor WebKitIntent;
 
-    [Replaceable] readonly attribute DeliveredIntent webkitIntent;
+    [Replaceable, V8EnabledAtRuntime] readonly attribute DeliveredIntent webkitIntent;
 };
 

Modified: branches/chromium/1312/Source/WebCore/Modules/intents/NavigatorIntents.idl (137211 => 137212)


--- branches/chromium/1312/Source/WebCore/Modules/intents/NavigatorIntents.idl	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebCore/Modules/intents/NavigatorIntents.idl	2012-12-10 23:06:42 UTC (rev 137212)
@@ -21,9 +21,9 @@
     Conditional=WEB_INTENTS,
     Supplemental=Navigator
 ] interface NavigatorIntents {
-    void webkitStartActivity(in Intent intent,
-                             in [Callback, Optional] IntentResultCallback successCallback,
-                             in [Callback, Optional] IntentResultCallback failureCallback)
+    [V8EnabledAtRuntime] void webkitStartActivity(in Intent intent,
+                                                  in [Callback, Optional] IntentResultCallback successCallback,
+                                                  in [Callback, Optional] IntentResultCallback failureCallback)
         raises(DOMException);
 };
 

Modified: branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (137211 => 137212)


--- branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2012-12-10 23:06:42 UTC (rev 137212)
@@ -241,4 +241,8 @@
 bool RuntimeEnabledFeatures::isDialogElementEnabled = false;
 #endif
 
+#if ENABLE(WEB_INTENTS)
+bool RuntimeEnabledFeatures::isWebIntentsEnabled = true;
+#endif
+
 } // namespace WebCore

Modified: branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (137211 => 137212)


--- branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-12-10 23:06:42 UTC (rev 137212)
@@ -259,6 +259,13 @@
     // The lang attribute support is incomplete and should only be turned on for tests.
     static void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { isLangAttributeAwareFormControlUIEnabled = isEnabled; }
 
+#if ENABLE(WEB_INTENTS)
+    static bool webkitStartActivityEnabled() { return isWebIntentsEnabled; }
+    static bool webkitIntentEnabled() { return isWebIntentsEnabled; }
+    static bool webKitIntentEnabled() { return isWebIntentsEnabled; }
+    static void setWebIntentsEnabled(bool isEnabled) { isWebIntentsEnabled = isEnabled; }
+#endif
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures() { }
@@ -359,6 +366,11 @@
 #if ENABLE(DIALOG_ELEMENT)
     static bool isDialogElementEnabled;
 #endif
+
+#if ENABLE(WEB_INTENTS)
+    static bool isWebIntentsEnabled;
+#endif
+
 };
 
 } // namespace WebCore

Modified: branches/chromium/1312/Source/WebKit/chromium/public/WebRuntimeFeatures.h (137211 => 137212)


--- branches/chromium/1312/Source/WebKit/chromium/public/WebRuntimeFeatures.h	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebKit/chromium/public/WebRuntimeFeatures.h	2012-12-10 23:06:42 UTC (rev 137212)
@@ -159,6 +159,10 @@
     WEBKIT_EXPORT static void enableCSSExclusions(bool);
     WEBKIT_EXPORT static bool isCSSExclusionsEnabled();
 
+
+    WEBKIT_EXPORT static void enableWebIntents(bool);
+    WEBKIT_EXPORT static bool isWebIntentsEnabled();
+
 private:
     WebRuntimeFeatures();
 };

Modified: branches/chromium/1312/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp (137211 => 137212)


--- branches/chromium/1312/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp	2012-12-10 23:01:20 UTC (rev 137211)
+++ branches/chromium/1312/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp	2012-12-10 23:06:42 UTC (rev 137212)
@@ -657,4 +657,22 @@
     return RuntimeEnabledFeatures::cssExclusionsEnabled();
 }
 
+void WebRuntimeFeatures::enableWebIntents(bool enable)
+{
+#if ENABLE(WEB_INTENTS)
+    RuntimeEnabledFeatures::setWebIntentsEnabled(enable);
+#else
+    UNUSED_PARAM(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isWebIntentsEnabled()
+{
+#if ENABLE(WEB_INTENTS)
+    return RuntimeEnabledFeatures::webkitStartActivityEnabled();
+#else
+    return false;
+#endif
+}
+
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to