Move more WKPreferences to WKWebViewConfiguration
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jun 2014 19:49:57 +0000 (19:49 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Jun 2014 19:49:57 +0000 (19:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133756
<rdar://problem/17271468>

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences setMinimumFontSize:]):
(-[WKPreferences suppressesIncrementalRendering]): Deleted.
(-[WKPreferences setSuppressesIncrementalRendering:]): Deleted.
(-[WKPreferences allowsInlineMediaPlayback]): Deleted.
(-[WKPreferences setAllowsInlineMediaPlayback:]): Deleted.
(-[WKPreferences mediaPlaybackRequiresUserAction]): Deleted.
(-[WKPreferences setMediaPlaybackRequiresUserAction:]): Deleted.
(-[WKPreferences mediaPlaybackAllowsAirPlay]): Deleted.
(-[WKPreferences setMediaPlaybackAllowsAirPlay:]): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
* WebKit2.xcodeproj/project.pbxproj:

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index 8c0512e..ba8c75c 100644 (file)
@@ -1,3 +1,29 @@
+2014-06-11  Anders Carlsson  <andersca@apple.com>
+
+        Move more WKPreferences to WKWebViewConfiguration
+        https://bugs.webkit.org/show_bug.cgi?id=133756
+        <rdar://problem/17271468>
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/WKPreferences.h:
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences setMinimumFontSize:]):
+        (-[WKPreferences suppressesIncrementalRendering]): Deleted.
+        (-[WKPreferences setSuppressesIncrementalRendering:]): Deleted.
+        (-[WKPreferences allowsInlineMediaPlayback]): Deleted.
+        (-[WKPreferences setAllowsInlineMediaPlayback:]): Deleted.
+        (-[WKPreferences mediaPlaybackRequiresUserAction]): Deleted.
+        (-[WKPreferences setMediaPlaybackRequiresUserAction:]): Deleted.
+        (-[WKPreferences mediaPlaybackAllowsAirPlay]): Deleted.
+        (-[WKPreferences setMediaPlaybackAllowsAirPlay:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]):
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration copyWithZone:]):
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-06-11  Enrica Casucci  <enrica@apple.com>
 
         WebKit2 iOS: Unable to open UI menu for "open in new tab" for links on yahoo.com.
index de68f3e..08db52a 100644 (file)
@@ -67,26 +67,6 @@ WK_CLASS_AVAILABLE(10_10, 8_0)
  */
 @property (nonatomic) BOOL javaScriptCanOpenWindowsAutomatically;
 
-#if TARGET_OS_IPHONE
-/*! @abstract A Boolean value indicating whether HTML5 videos play inline
- (YES) or use the native full-screen controller (NO).
- @discussion The default value is NO.
- */
-@property (nonatomic) BOOL allowsInlineMediaPlayback;
-
-/*! @abstract A Boolean value indicating whether HTML5 videos require the
- user to start playing them (YES) or can play automatically (NO).
- @discussion The default value is YES.
- */
-@property (nonatomic) BOOL mediaPlaybackRequiresUserAction;
-
-/*! @abstract A Boolean value indicating whether AirPlay is allowed.
- @discussion The default value is YES.
- */
-@property (nonatomic) BOOL mediaPlaybackAllowsAirPlay;
-
-#endif
-
 #if !TARGET_OS_IPHONE
 /*! @abstract A Boolean value indicating whether Java is enabled.
  @discussion The default value is YES.
index edd251b..af48601 100644 (file)
     return _preferences->minimumFontSize();
 }
 
+- (void)setMinimumFontSize:(CGFloat)minimumFontSize
+{
+    _preferences->setMinimumFontSize(minimumFontSize);
+}
+
 - (BOOL)isJavaScriptEnabled
 {
     return _preferences->javaScriptEnabled();
     _preferences->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
 }
 
-- (BOOL)suppressesIncrementalRendering
-{
-    return _preferences->suppressesIncrementalRendering();
-}
-
-- (void)setSuppressesIncrementalRendering:(BOOL)suppressesIncrementalRendering
-{
-    _preferences->setSuppressesIncrementalRendering(suppressesIncrementalRendering);
-}
-
-- (void)setMinimumFontSize:(CGFloat)minimumFontSize
-{
-    _preferences->setMinimumFontSize(minimumFontSize);
-}
-
-#pragma mark iOS-specific methods
-
-#if PLATFORM(IOS)
-
-- (BOOL)allowsInlineMediaPlayback
-{
-    return _preferences->mediaPlaybackAllowsInline();
-}
-
-- (void)setAllowsInlineMediaPlayback:(BOOL)allowsInlineMediaPlayback
-{
-    _preferences->setMediaPlaybackAllowsInline(allowsInlineMediaPlayback);
-}
-
-- (BOOL)mediaPlaybackRequiresUserAction
-{
-    return _preferences->mediaPlaybackRequiresUserGesture();
-}
-
-- (void)setMediaPlaybackRequiresUserAction:(BOOL)mediaPlaybackRequiresUserAction
-{
-    _preferences->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserAction);
-}
-
-- (BOOL)mediaPlaybackAllowsAirPlay
-{
-    return _preferences->mediaPlaybackAllowsAirPlay();
-}
-
-- (void)setMediaPlaybackAllowsAirPlay:(BOOL)mediaPlaybackAllowsAirPlay
-{
-    _preferences->setMediaPlaybackAllowsAirPlay(mediaPlaybackAllowsAirPlay);
-}
-
-#endif
-
 #pragma mark OS X-specific methods
 
 #if PLATFORM(MAC)
index 22e63b2..48b472e 100644 (file)
@@ -253,6 +253,12 @@ static int32_t deviceOrientation()
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::suppressesIncrementalRenderingKey(), WebKit::WebPreferencesStore::Value(!![_configuration suppressesIncrementalRendering]));
 
 #if PLATFORM(IOS)
+    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsAirPlayKey(), WebKit::WebPreferencesStore::Value(!![_configuration allowsInlineMediaPlayback]));
+    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackRequiresUserGestureKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackRequiresUserAction]));
+    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsAirPlayKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackAllowsAirPlay]));
+#endif
+
+#if PLATFORM(IOS)
     _scrollView = adoptNS([[WKScrollView alloc] initWithFrame:bounds]);
     [_scrollView setInternalDelegate:self];
     [_scrollView setBouncesZoom:YES];
index 78132e4..54532a3 100644 (file)
@@ -62,6 +62,26 @@ WK_CLASS_AVAILABLE(10_10, 8_0)
  */
 @property (nonatomic) BOOL suppressesIncrementalRendering;
 
+#if TARGET_OS_IPHONE
+/*! @abstract A Boolean value indicating whether HTML5 videos play inline
+ (YES) or use the native full-screen controller (NO).
+ @discussion The default value is NO.
+ */
+@property (nonatomic) BOOL allowsInlineMediaPlayback;
+
+/*! @abstract A Boolean value indicating whether HTML5 videos require the
+ user to start playing them (YES) or can play automatically (NO).
+ @discussion The default value is YES.
+ */
+@property (nonatomic) BOOL mediaPlaybackRequiresUserAction;
+
+/*! @abstract A Boolean value indicating whether AirPlay is allowed.
+ @discussion The default value is YES.
+ */
+@property (nonatomic) BOOL mediaPlaybackAllowsAirPlay;
+
+#endif
+
 @end
 
 #endif
index 3acf13e..ec4ac69 100644 (file)
@@ -99,6 +99,11 @@ private:
 #endif
 
     configuration->_suppressesIncrementalRendering = self->_suppressesIncrementalRendering;
+#if PLATFORM(IOS)
+    configuration->_allowsInlineMediaPlayback = self->_allowsInlineMediaPlayback;
+    configuration->_mediaPlaybackRequiresUserAction = self->_mediaPlaybackRequiresUserAction;
+    configuration->_mediaPlaybackAllowsAirPlay = self->_mediaPlaybackAllowsAirPlay;
+#endif
 
     return configuration;
 }
index 08e96b7..da0cf6d 100644 (file)
                1A2A4B0E1586A2240090C9E9 /* ColorSpaceData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A4AFD158693920090C9E9 /* ColorSpaceData.mm */; };
                1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2BB6CE14117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp */; };
                1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2BB6CF14117B4D000F35D4 /* PluginProcessConnectionMessages.h */; };
-               1A2D252B194688FD004537B0 /* WKErrorInternal.h in Copy Files */ = {isa = PBXBuildFile; fileRef = 1A2D252A194688FD004537B0 /* WKErrorInternal.h */; };
                1A2D82A4127F4EAB001EB962 /* NPObjectMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1FA35C127A45BF0050E709 /* NPObjectMessageReceiver.cpp */; };
                1A2D82A5127F4EAB001EB962 /* NPObjectMessageReceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1FA35B127A45BF0050E709 /* NPObjectMessageReceiver.h */; };
                1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1FA284127A13BC0050E709 /* NPObjectProxy.cpp */; };
                        dstPath = WebKit.framework;
                        dstSubfolderSpec = 1;
                        files = (
-                               1A2D252B194688FD004537B0 /* WKErrorInternal.h in Copy Files */,
                                510CC8491613C85C00D03ED3 /* NetworkProcess.app in Copy Files */,
                                BCDE0ABF13272708001259FB /* PluginProcess.app in Copy Files */,
                                51A60B2A180CCEB500F3BF50 /* DatabaseProcess.app in Copy Files */,