Changeset 163681 in webkit
- Timestamp:
- Feb 7, 2014 6:38:02 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r163680 r163681 1 2014-02-07 Anders Carlsson <andersca@apple.com> 2 3 Pass the preferences through from the WKWebViewConfiguration object 4 https://bugs.webkit.org/show_bug.cgi?id=128430 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/Cocoa/WKPreferences.h: 9 * UIProcess/API/Cocoa/WKPreferences.mm: 10 (-[WKPreferences init]): 11 Don't return nil if [super init] returns a valid object. 12 13 (-[WKPreferences minimumFontSize]): 14 (-[WKPreferences setMinimumFontSize:]): 15 Change this property to be unsigned. 16 17 * UIProcess/API/Cocoa/WKPreferencesInternal.h: 18 Use @package. 19 20 * UIProcess/API/Cocoa/WKWebView.mm: 21 (-[WKWebView initWithFrame:configuration:]): 22 Set up a WebKit::WebPageConfiguration and use the new -[WKView initWithFrame:context:configuration:] method. 23 24 * UIProcess/API/ios/WKContentView.mm: 25 (-[WKContentView initWithFrame:configuration:]): 26 Set the preferences. 27 28 * UIProcess/API/mac/WKView.mm: 29 (-[WKView initWithFrame:context:configuration:]): 30 Add a new initializer that takes a WebContext and a WebPageConfiguration. 31 32 (-[WKView _registerDraggedTypes]): 33 This shouldn't be in the private category. 34 35 (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]): 36 Call the new initializer. 37 38 * UIProcess/API/mac/WKViewInternal.h: 39 1 40 2014-02-07 Tim Horton <timothy_horton@apple.com> 2 41 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h
r163663 r163681 36 36 @interface WKPreferences : NSObject 37 37 38 @property (nonatomic) intminimumFontSize;38 @property (nonatomic) unsigned minimumFontSize; 39 39 40 40 @end -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm
r163663 r163681 35 35 - (instancetype)init 36 36 { 37 if ( (self = [super init]))37 if (!(self = [super init])) 38 38 return nil; 39 39 … … 43 43 } 44 44 45 - ( int)minimumFontSize45 - (unsigned)minimumFontSize 46 46 { 47 47 return _preferences->minimumFontSize(); 48 48 } 49 49 50 - (void)setMinimumFontSize:( int)minimumFontSize50 - (void)setMinimumFontSize:(unsigned)minimumFontSize 51 51 { 52 52 _preferences->setMinimumFontSize(minimumFontSize); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesInternal.h
r163663 r163681 35 35 36 36 @interface WKPreferences () { 37 @package 37 38 RefPtr<WebKit::WebPreferences> _preferences; 38 39 } -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r163663 r163681 36 36 #import "WKNavigationInternal.h" 37 37 #import "WKPreferencesInternal.h" 38 #import "WKProcessClass .h"38 #import "WKProcessClassInternal.h" 39 39 #import "WKRemoteObjectRegistryInternal.h" 40 40 #import "WKWebViewConfiguration.h" … … 111 111 112 112 #if PLATFORM(MAC) && !PLATFORM(IOS) 113 _wkView = [[WKView alloc] initWithFrame:bounds configuration:_configuration.get()]; 113 WebKit::WebPageConfiguration webPageConfiguration; 114 webPageConfiguration.preferences = [_configuration preferences]->_preferences.get(); 115 116 _wkView = [[WKView alloc] initWithFrame:bounds context:*[_configuration.get() processClass]->_context configuration:std::move(webPageConfiguration)]; 114 117 [self addSubview:_wkView.get()]; 115 118 _page = WebKit::toImpl([_wkView pageRef]); -
trunk/Source/WebKit2/UIProcess/API/ios/WKContentView.mm
r163680 r163681 36 36 #import "WKGeolocationProviderIOS.h" 37 37 #import "WKInteractionView.h" 38 #import "WKPreferencesInternal.h" 38 39 #import "WKProcessGroupPrivate.h" 39 40 #import "WKProcessClassInternal.h" … … 105 106 106 107 WebPageConfiguration webPageConfiguration; 108 webPageConfiguration.preferences = [_configuration preferences]->_preferences.get(); 107 109 108 110 _page = configuration.processClass->_context->createWebPage(*_pageClient, std::move(webPageConfiguration)); -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r163673 r163681 60 60 #import "WKViewInternal.h" 61 61 #import "WKViewPrivate.h" 62 #import "WKWebViewConfiguration.h"63 62 #import "WebBackForwardList.h" 64 63 #import "WebContext.h" … … 258 257 259 258 #if WK_API_ENABLED 260 261 - (instancetype)initWithFrame:(CGRect)frame configuration:(WKWebViewConfiguration *)configuration262 {263 return [self initWithFrame:frame contextRef:toAPI(configuration.processClass->_context.get()) pageGroupRef:nullptr];264 }265 259 266 260 - (id)initWithFrame:(NSRect)frame processGroup:(WKProcessGroup *)processGroup browsingContextGroup:(WKBrowsingContextGroup *)browsingContextGroup … … 2887 2881 } 2888 2882 2889 @end 2890 2891 @implementation WKView (Private) 2892 2893 - (void)saveBackForwardSnapshotForCurrentItem 2894 { 2895 _data->_page->recordNavigationSnapshot(); 2896 } 2897 2898 - (void)_registerDraggedTypes 2899 { 2900 NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()]; 2901 [types addObjectsFromArray:PasteboardTypes::forURL()]; 2902 [self registerForDraggedTypes:[types allObjects]]; 2903 [types release]; 2904 } 2905 2906 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef 2907 { 2908 return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:nil]; 2909 } 2910 2911 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage 2883 - (instancetype)initWithFrame:(NSRect)frame context:(WebContext&)context configuration:(WebPageConfiguration)webPageConfiguration 2912 2884 { 2913 2885 self = [super initWithFrame:frame]; … … 2934 2906 2935 2907 _data = [[WKViewData alloc] init]; 2936 2937 WebPageConfiguration webPageConfiguration;2938 webPageConfiguration.pageGroup = toImpl(pageGroupRef);2939 webPageConfiguration.relatedPage = toImpl(relatedPage);2940 2941 2908 _data->_pageClient = std::make_unique<PageClientImpl>(self); 2942 _data->_page = toImpl(contextRef)->createWebPage(*_data->_pageClient, std::move(webPageConfiguration));2909 _data->_page = context.createWebPage(*_data->_pageClient, std::move(webPageConfiguration)); 2943 2910 _data->_page->setIntrinsicDeviceScaleFactor([self _intrinsicDeviceScaleFactor]); 2944 2911 _data->_page->initializeWebPage(); … … 2967 2934 2968 2935 return self; 2936 } 2937 2938 - (void)_registerDraggedTypes 2939 { 2940 NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()]; 2941 [types addObjectsFromArray:PasteboardTypes::forURL()]; 2942 [self registerForDraggedTypes:[types allObjects]]; 2943 [types release]; 2944 } 2945 2946 @end 2947 2948 @implementation WKView (Private) 2949 2950 - (void)saveBackForwardSnapshotForCurrentItem 2951 { 2952 _data->_page->recordNavigationSnapshot(); 2953 } 2954 2955 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef 2956 { 2957 return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef relatedToPage:nil]; 2958 } 2959 2960 - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef relatedToPage:(WKPageRef)relatedPage 2961 { 2962 WebPageConfiguration webPageConfiguration; 2963 webPageConfiguration.pageGroup = toImpl(pageGroupRef); 2964 webPageConfiguration.relatedPage = toImpl(relatedPage); 2965 2966 return [self initWithFrame:frame context:*toImpl(contextRef) configuration:webPageConfiguration]; 2969 2967 } 2970 2968 -
trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
r163116 r163681 44 44 45 45 namespace WebKit { 46 class DrawingAreaProxy; 47 class FindIndicator; 48 class LayerTreeContext; 49 struct ColorSpaceData; 50 struct EditorState; 46 class DrawingAreaProxy; 47 class FindIndicator; 48 class LayerTreeContext; 49 class WebContext; 50 struct ColorSpaceData; 51 struct EditorState; 52 struct WebPageConfiguration; 51 53 } 52 54 … … 55 57 @interface WKView () 56 58 #if WK_API_ENABLED 57 - (instancetype)initWithFrame:(CGRect)frame con figuration:(WKWebViewConfiguration *)configuration;59 - (instancetype)initWithFrame:(CGRect)frame context:(WebKit::WebContext&)context configuration:(WebKit::WebPageConfiguration)webPageConfiguration; 58 60 #endif 59 61
Note: See TracChangeset
for help on using the changeset viewer.