Title: [98622] trunk
- Revision
- 98622
- Author
- [email protected]
- Date
- 2011-10-27 13:01:59 -0700 (Thu, 27 Oct 2011)
Log Message
Add allowsPlugIns property to WKBrowsingContextGroup
https://bugs.webkit.org/show_bug.cgi?id=70987
Reviewed by Anders Carlsson.
Source/WebKit2:
Test: WKBrowsingContextGroupTest.GetSetPluginsEnabled
* UIProcess/API/mac/WKBrowsingContextGroup.h:
* UIProcess/API/mac/WKBrowsingContextGroup.mm:
(-[WKBrowsingContextGroup allowsJavaScript]):
(-[WKBrowsingContextGroup setAllowsJavaScript:]):
Rename to allowsJavaScript/setAllowsJavaScript.
(-[WKBrowsingContextGroup allowsPlugIns]):
(-[WKBrowsingContextGroup setAllowsPlugIns:]):
Add allowsPlugIns/setAllowsPlugIns.
Tools:
* TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
Add basic test for WKBrowsingContextGroup.allowsPlugIns.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (98621 => 98622)
--- trunk/Source/WebKit2/ChangeLog 2011-10-27 20:01:28 UTC (rev 98621)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-27 20:01:59 UTC (rev 98622)
@@ -1,3 +1,22 @@
+2011-10-27 Sam Weinig <[email protected]>
+
+ Add allowsPlugIns property to WKBrowsingContextGroup
+ https://bugs.webkit.org/show_bug.cgi?id=70987
+
+ Reviewed by Anders Carlsson.
+
+ Test: WKBrowsingContextGroupTest.GetSetPluginsEnabled
+
+ * UIProcess/API/mac/WKBrowsingContextGroup.h:
+ * UIProcess/API/mac/WKBrowsingContextGroup.mm:
+ (-[WKBrowsingContextGroup allowsJavaScript]):
+ (-[WKBrowsingContextGroup setAllowsJavaScript:]):
+ Rename to allowsJavaScript/setAllowsJavaScript.
+
+ (-[WKBrowsingContextGroup allowsPlugIns]):
+ (-[WKBrowsingContextGroup setAllowsPlugIns:]):
+ Add allowsPlugIns/setAllowsPlugIns.
+
2011-10-27 Carlos Garcia Campos <[email protected]>
[Cairo] Implement ShareableBitmap::paint() when scaleFactor=1
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h (98621 => 98622)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h 2011-10-27 20:01:28 UTC (rev 98621)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.h 2011-10-27 20:01:59 UTC (rev 98622)
@@ -39,6 +39,14 @@
/* Settings */
-@property(getter = isJavaScriptEnabled) BOOL _javascript_Enabled;
+/* Setting to control whether _javascript_ referenced by a page is enabled.
+ Default: YES
+*/
+@property BOOL allowsJavaScript;
+/* Setting to control whether plug-ins are enabled.
+ Default: YES
+*/
+@property BOOL allowsPlugIns;
+
@end
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm (98621 => 98622)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm 2011-10-27 20:01:28 UTC (rev 98621)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextGroup.mm 2011-10-27 20:01:59 UTC (rev 98622)
@@ -61,16 +61,26 @@
[super dealloc];
}
-- (BOOL)isJavaScriptEnabled
+- (BOOL)allowsJavaScript
{
return WKPreferencesGetJavaScriptEnabled(WKPageGroupGetPreferences(self.pageGroupRef));
}
-- (void)setJavaScriptEnabled:(BOOL)_javascript_Enabled
+- (void)setAllowsJavaScript:(BOOL)allowsJavaScript
{
- WKPreferencesSetJavaScriptEnabled(WKPageGroupGetPreferences(self.pageGroupRef), _javascript_Enabled);
+ WKPreferencesSetJavaScriptEnabled(WKPageGroupGetPreferences(self.pageGroupRef), allowsJavaScript);
}
+- (BOOL)allowsPlugIns
+{
+ return WKPreferencesGetPluginsEnabled(WKPageGroupGetPreferences(self.pageGroupRef));
+}
+
+- (void)setAllowsPlugIns:(BOOL)allowsPlugIns
+{
+ WKPreferencesSetPluginsEnabled(WKPageGroupGetPreferences(self.pageGroupRef), allowsPlugIns);
+}
+
@end
@implementation WKBrowsingContextGroup (Internal)
Modified: trunk/Tools/ChangeLog (98621 => 98622)
--- trunk/Tools/ChangeLog 2011-10-27 20:01:28 UTC (rev 98621)
+++ trunk/Tools/ChangeLog 2011-10-27 20:01:59 UTC (rev 98622)
@@ -1,3 +1,13 @@
+2011-10-27 Sam Weinig <[email protected]>
+
+ Add allowsPlugIns property to WKBrowsingContextGroup
+ https://bugs.webkit.org/show_bug.cgi?id=70987
+
+ Reviewed by Anders Carlsson.
+
+ * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm:
+ Add basic test for WKBrowsingContextGroup.allowsPlugIns.
+
2011-10-27 Adam Roben <[email protected]>
Test WKBundlePageGetBackingScaleFactor
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm (98621 => 98622)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm 2011-10-27 20:01:28 UTC (rev 98621)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm 2011-10-27 20:01:59 UTC (rev 98622)
@@ -32,13 +32,24 @@
{
WKBrowsingContextGroup *browsingContextGroup = [[WKBrowsingContextGroup alloc] initWithIdentifier:@"TestIdentifier"];
- ASSERT_TRUE(browsingContextGroup._javascript_Enabled);
- ASSERT_TRUE([browsingContextGroup isJavaScriptEnabled]);
+ ASSERT_TRUE(browsingContextGroup.allowsJavaScript);
- browsingContextGroup._javascript_Enabled = NO;
+ browsingContextGroup.allowsJavaScript = NO;
- ASSERT_FALSE(browsingContextGroup._javascript_Enabled);
- ASSERT_FALSE([browsingContextGroup isJavaScriptEnabled]);
+ ASSERT_FALSE(browsingContextGroup.allowsJavaScript);
[browsingContextGroup release];
}
+
+TEST(WKBrowsingContextGroupTest, GetSetPluginsEnabled)
+{
+ WKBrowsingContextGroup *browsingContextGroup = [[WKBrowsingContextGroup alloc] initWithIdentifier:@"TestIdentifier"];
+
+ ASSERT_TRUE(browsingContextGroup.allowsPlugIns);
+
+ browsingContextGroup.allowsPlugIns = NO;
+
+ ASSERT_FALSE(browsingContextGroup.allowsPlugIns);
+
+ [browsingContextGroup release];
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes