Changeset 194076 in webkit
- Timestamp:
- Dec 14, 2015, 4:35:22 PM (11 years ago)
- Location:
- branches/safari-601-branch/Source/WebKit2
- Files:
-
- 11 edited
- 4 copied
-
ChangeLog (modified) (1 diff)
-
Shared/API/APIObject.h (modified) (1 diff)
-
Shared/API/c/WKBase.h (modified) (1 diff)
-
Shared/Cocoa/APIObject.mm (modified) (2 diffs)
-
UIProcess/API/APIWindowFeatures.cpp (copied) (copied from branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h ) (2 diffs)
-
UIProcess/API/APIWindowFeatures.h (copied) (copied from branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h ) (2 diffs)
-
UIProcess/API/C/WKAPICast.h (modified) (2 diffs)
-
UIProcess/API/C/WKPage.cpp (modified) (3 diffs)
-
UIProcess/API/C/WKPageUIClient.h (modified) (10 diffs)
-
UIProcess/API/C/WKWindowFeaturesRef.cpp (copied) (copied from branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h ) (2 diffs)
-
UIProcess/API/C/WKWindowFeaturesRef.h (copied) (copied from branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h ) (2 diffs)
-
UIProcess/API/Cocoa/WKWindowFeatures.mm (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWindowFeaturesInternal.h (modified) (1 diff)
-
UIProcess/Cocoa/UIDelegate.mm (modified) (1 diff)
-
WebKit2.xcodeproj/project.pbxproj (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-601-branch/Source/WebKit2/ChangeLog
r194075 r194076 1 2015-12-08 Harris Papadopoulos <cpapadopoulos@apple.com> 2 3 Merge r188553. rdar://problem/23816165 4 5 2015-08-13 Anders Carlsson <andersca@apple.com> 6 7 Add WKWindowFeaturesRef and a new modern createNewPage UI client callback 8 https://bugs.webkit.org/show_bug.cgi?id=147989 9 10 Reviewed by Tim Horton. 11 12 Re-land this and make sure we actually allocate a WKWindowFeatures object. 13 14 * Platform/IPC/mac/ConnectionMac.mm: 15 * Shared/API/APIObject.h: 16 * Shared/API/c/WKBase.h: 17 * UIProcess/API/APIWindowFeatures.cpp: Added. 18 * UIProcess/API/APIWindowFeatures.h: Added. 19 * UIProcess/API/C/WKAPICast.h: 20 * UIProcess/API/C/WKPage.cpp: 21 (WKPageSetPageUIClient): 22 * UIProcess/API/C/WKPageUIClient.h: 23 * UIProcess/API/C/WKWindowFeaturesRef.cpp: Added. 24 (WKWindowFeaturesGetTypeID): 25 * UIProcess/API/C/WKWindowFeaturesRef.h: Added. 26 * UIProcess/API/Cocoa/WKWindowFeatures.mm: 27 (-[WKWindowFeatures dealloc]): 28 (-[WKWindowFeatures menuBarVisibility]): 29 (-[WKWindowFeatures statusBarVisibility]): 30 (-[WKWindowFeatures toolbarsVisibility]): 31 (-[WKWindowFeatures allowsResizing]): 32 (-[WKWindowFeatures x]): 33 (-[WKWindowFeatures y]): 34 (-[WKWindowFeatures width]): 35 (-[WKWindowFeatures height]): 36 (-[WKWindowFeatures _apiObject]): 37 (-[WKWindowFeatures _initWithWindowFeatures:]): Deleted. 38 * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: 39 (WebKit::wrapper): 40 * UIProcess/Cocoa/UIDelegate.mm: 41 (WebKit::UIDelegate::UIClient::createNewPage): 42 * WebKit2.xcodeproj/project.pbxproj: 43 1 44 2015-12-08 Harris Papadopoulos <cpapadopoulos@apple.com> 2 45 -
branches/safari-601-branch/Source/WebKit2/Shared/API/APIObject.h
r186484 r194076 149 149 WebsiteDataRecord, 150 150 WebsiteDataStore, 151 WindowFeatures, 151 152 152 153 #if ENABLE(MEDIA_SESSION) -
branches/safari-601-branch/Source/WebKit2/Shared/API/c/WKBase.h
r186484 r194076 142 142 typedef const struct OpaqueWKViewportAttributes* WKViewportAttributesRef; 143 143 typedef const struct OpaqueWKWebsiteDataStore* WKWebsiteDataStoreRef; 144 typedef const struct OpaqueWKWindowFeatures* WKWindowFeaturesRef; 144 145 145 146 /* WebKit2 Bundle types */ -
branches/safari-601-branch/Source/WebKit2/Shared/Cocoa/APIObject.mm
r185877 r194076 61 61 #import "WKWebsiteDataRecordInternal.h" 62 62 #import "WKWebsiteDataStoreInternal.h" 63 #import "WKWindowFeaturesInternal.h" 63 64 #import "_WKDownloadInternal.h" 64 65 #import "_WKFrameHandleInternal.h" … … 218 219 break; 219 220 221 case Type::WindowFeatures: 222 wrapper = [WKWindowFeatures alloc]; 223 break; 224 220 225 case Type::BundleFrame: 221 226 wrapper = [WKWebProcessPlugInFrame alloc]; -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/APIWindowFeatures.cpp
r194075 r194076 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "WKWindowFeatures.h" 26 #include "config.h" 27 #include "APIWindowFeatures.h" 27 28 28 #if WK_API_ENABLED 29 namespace API { 29 30 30 namespace WebCore { 31 struct WindowFeatures; 31 Ref<WindowFeatures> WindowFeatures::create(const WebCore::WindowFeatures& windowFeatures) 32 { 33 return adoptRef(*new WindowFeatures(windowFeatures)); 32 34 } 33 35 34 @interface WKWindowFeatures () 36 WindowFeatures::WindowFeatures(const WebCore::WindowFeatures& windowFeatures) 37 : m_windowFeatures(windowFeatures) 38 { 39 } 35 40 36 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures; 41 WindowFeatures::~WindowFeatures() 42 { 43 } 37 44 38 @end 39 40 #endif 45 } -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/APIWindowFeatures.h
r194075 r194076 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "WKWindowFeatures.h" 26 #ifndef APIWindowFeatures_h 27 #define APIWindowFeatures_h 27 28 28 #if WK_API_ENABLED 29 #include "APIObject.h" 30 #include <WebCore/WindowFeatures.h> 29 31 30 namespace WebCore { 31 struct WindowFeatures; 32 namespace API { 33 34 class WindowFeatures final : public ObjectImpl<Object::Type::WindowFeatures> { 35 public: 36 static Ref<WindowFeatures> create(const WebCore::WindowFeatures&); 37 virtual ~WindowFeatures(); 38 39 const WebCore::WindowFeatures& windowFeatures() const { return m_windowFeatures; } 40 41 private: 42 explicit WindowFeatures(const WebCore::WindowFeatures&); 43 44 const WebCore::WindowFeatures m_windowFeatures; 45 }; 46 32 47 } 33 48 34 @interface WKWindowFeatures () 35 36 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures; 37 38 @end 39 40 #endif 49 #endif // APIWindowFeatures_h -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKAPICast.h
r187084 r194076 65 65 class UserScript; 66 66 class WebsiteDataStore; 67 class WindowFeatures; 67 68 } 68 69 … … 165 166 WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes) 166 167 WK_ADD_API_MAPPING(WKWebsiteDataStoreRef, API::WebsiteDataStore) 168 WK_ADD_API_MAPPING(WKWindowFeaturesRef, API::WindowFeatures) 167 169 168 170 /* Enum conversions */ -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r194075 r194076 42 42 #include "APISessionState.h" 43 43 #include "APIUIClient.h" 44 #include "APIWindowFeatures.h" 44 45 #include "AuthenticationChallengeProxy.h" 45 46 #include "LegacySessionStateCoding.h" … … 103 104 104 105 template<> struct ClientTraits<WKPageUIClientBase> { 105 typedef std::tuple<WKPageUIClientV0, WKPageUIClientV1, WKPageUIClientV2, WKPageUIClientV3, WKPageUIClientV4, WKPageUIClientV5 > Versions;106 typedef std::tuple<WKPageUIClientV0, WKPageUIClientV1, WKPageUIClientV2, WKPageUIClientV3, WKPageUIClientV4, WKPageUIClientV5, WKPageUIClientV6> Versions; 106 107 }; 107 108 … … 1342 1343 1343 1344 private: 1344 virtual PassRefPtr<WebPageProxy> createNewPage(WebPageProxy* page, WebFrameProxy*, const SecurityOriginData&, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override 1345 { 1346 if (!m_client.base.version && !m_client.createNewPage_deprecatedForUseWithV0) 1347 return 0; 1348 1349 if (m_client.base.version > 0 && !m_client.createNewPage) 1350 return 0; 1351 1352 API::Dictionary::MapType map; 1353 if (windowFeatures.x) 1354 map.set("x", API::Double::create(*windowFeatures.x)); 1355 if (windowFeatures.y) 1356 map.set("y", API::Double::create(*windowFeatures.y)); 1357 if (windowFeatures.width) 1358 map.set("width", API::Double::create(*windowFeatures.width)); 1359 if (windowFeatures.height) 1360 map.set("height", API::Double::create(*windowFeatures.height)); 1361 map.set("menuBarVisible", API::Boolean::create(windowFeatures.menuBarVisible)); 1362 map.set("statusBarVisible", API::Boolean::create(windowFeatures.statusBarVisible)); 1363 map.set("toolBarVisible", API::Boolean::create(windowFeatures.toolBarVisible)); 1364 map.set("locationBarVisible", API::Boolean::create(windowFeatures.locationBarVisible)); 1365 map.set("scrollbarsVisible", API::Boolean::create(windowFeatures.scrollbarsVisible)); 1366 map.set("resizable", API::Boolean::create(windowFeatures.resizable)); 1367 map.set("fullscreen", API::Boolean::create(windowFeatures.fullscreen)); 1368 map.set("dialog", API::Boolean::create(windowFeatures.dialog)); 1369 Ref<API::Dictionary> featuresMap = API::Dictionary::create(WTF::move(map)); 1370 1371 if (!m_client.base.version) 1372 return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))); 1373 1374 Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest); 1375 return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))); 1345 virtual PassRefPtr<WebPageProxy> createNewPage(WebPageProxy* page, WebFrameProxy* initiatingFrame, const SecurityOriginData& securityOriginData, const ResourceRequest& resourceRequest, const WindowFeatures& windowFeatures, const NavigationActionData& navigationActionData) override 1346 { 1347 if (m_client.base.version < 6) { 1348 if (!m_client.base.version && !m_client.createNewPage_deprecatedForUseWithV0) 1349 return nullptr; 1350 1351 if (!m_client.createNewPage_deprecatedForUseWithV1) 1352 return nullptr; 1353 1354 API::Dictionary::MapType map; 1355 if (windowFeatures.x) 1356 map.set("x", API::Double::create(*windowFeatures.x)); 1357 if (windowFeatures.y) 1358 map.set("y", API::Double::create(*windowFeatures.y)); 1359 if (windowFeatures.width) 1360 map.set("width", API::Double::create(*windowFeatures.width)); 1361 if (windowFeatures.height) 1362 map.set("height", API::Double::create(*windowFeatures.height)); 1363 map.set("menuBarVisible", API::Boolean::create(windowFeatures.menuBarVisible)); 1364 map.set("statusBarVisible", API::Boolean::create(windowFeatures.statusBarVisible)); 1365 map.set("toolBarVisible", API::Boolean::create(windowFeatures.toolBarVisible)); 1366 map.set("locationBarVisible", API::Boolean::create(windowFeatures.locationBarVisible)); 1367 map.set("scrollbarsVisible", API::Boolean::create(windowFeatures.scrollbarsVisible)); 1368 map.set("resizable", API::Boolean::create(windowFeatures.resizable)); 1369 map.set("fullscreen", API::Boolean::create(windowFeatures.fullscreen)); 1370 map.set("dialog", API::Boolean::create(windowFeatures.dialog)); 1371 Ref<API::Dictionary> featuresMap = API::Dictionary::create(WTF::move(map)); 1372 1373 if (!m_client.base.version) 1374 return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV0(toAPI(page), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))); 1375 1376 Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest); 1377 return adoptRef(toImpl(m_client.createNewPage_deprecatedForUseWithV1(toAPI(page), toAPI(request.ptr()), toAPI(featuresMap.ptr()), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), m_client.base.clientInfo))); 1378 } 1379 1380 if (!m_client.createNewPage) 1381 return nullptr; 1382 1383 auto configuration = page->configuration().copy(); 1384 configuration->setRelatedPage(page); 1385 1386 auto sourceFrameInfo = API::FrameInfo::create(*initiatingFrame, securityOriginData.securityOrigin()); 1387 1388 bool shouldOpenAppLinks = !protocolHostAndPortAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), resourceRequest.url()); 1389 auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, resourceRequest, WebCore::URL(), shouldOpenAppLinks); 1390 1391 auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); 1392 1393 return adoptRef(toImpl(m_client.createNewPage(toAPI(page), toAPI(configuration.ptr()), toAPI(apiNavigationAction.ptr()), toAPI(apiWindowFeatures.ptr()), m_client.base.clientInfo))); 1376 1394 } 1377 1395 -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPageUIClient.h
r186484 r194076 50 50 51 51 typedef void (*WKPageUIClientCallback)(WKPageRef page, const void* clientInfo); 52 typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WK URLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);52 typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKPageConfigurationRef configuration, WKNavigationActionRef navigationAction, WKWindowFeaturesRef windowFeatures, const void *clientInfo); 53 53 typedef void (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo); 54 54 typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, WKSecurityOriginRef securityOrigin, const void *clientInfo); … … 102 102 typedef bool (*WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void *clientInfo); 103 103 typedef WKStringRef (*WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void *clientInfo); 104 typedef WKPageRef (*WKPageCreateNewPageCallback_deprecatedForUseWithV1)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo); 104 105 105 106 typedef struct WKPageUIClientBase { … … 198 199 199 200 // Version 1. 200 WKPageCreateNewPageCallback createNewPage;201 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage; 201 202 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 202 203 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 249 250 250 251 // Version 1. 251 WKPageCreateNewPageCallback createNewPage;252 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage; 252 253 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 253 254 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 305 306 306 307 // Version 1. 307 WKPageCreateNewPageCallback createNewPage;308 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage; 308 309 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 309 310 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 364 365 365 366 // Version 1. 366 WKPageCreateNewPageCallback createNewPage;367 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage; 367 368 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 368 369 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 429 430 430 431 // Version 1. 431 WKPageCreateNewPageCallback createNewPage;432 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage; 432 433 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 433 434 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 457 458 } WKPageUIClientV5; 458 459 459 enum { kWKPageUIClientCurrentVersion WK_ENUM_DEPRECATED("Use an explicit version number instead") = 2 }; 460 typedef struct WKPageUIClient { 461 int version; 462 const void * clientInfo; 463 464 // Version 0. 465 WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0; 466 WKPageUIClientCallback showPage; 467 WKPageUIClientCallback close; 468 WKPageTakeFocusCallback takeFocus; 469 WKPageFocusCallback focus; 470 WKPageUnfocusCallback unfocus; 471 WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert; 472 WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm; 473 WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt; 460 typedef struct WKPageUIClientV6 { 461 WKPageUIClientBase base; 462 463 // Version 0. 464 WKPageCreateNewPageCallback_deprecatedForUseWithV0 createNewPage_deprecatedForUseWithV0; 465 WKPageUIClientCallback showPage; 466 WKPageUIClientCallback close; 467 WKPageTakeFocusCallback takeFocus; 468 WKPageFocusCallback focus; 469 WKPageUnfocusCallback unfocus; 470 WKPageRunJavaScriptAlertCallback_deprecatedForUseWithV0 runJavaScriptAlert_deprecatedForUseWithV0; 471 WKPageRunJavaScriptConfirmCallback_deprecatedForUseWithV0 runJavaScriptConfirm_deprecatedForUseWithV0; 472 WKPageRunJavaScriptPromptCallback_deprecatedForUseWithV0 runJavaScriptPrompt_deprecatedForUseWithV0; 474 473 WKPageSetStatusTextCallback setStatusText; 475 474 WKPageMouseDidMoveOverElementCallback_deprecatedForUseWithV0 mouseDidMoveOverElement_deprecatedForUseWithV0; … … 504 503 505 504 // Version 1. 506 WKPageCreateNewPageCallback createNewPage;505 WKPageCreateNewPageCallback_deprecatedForUseWithV1 createNewPage_deprecatedForUseWithV1; 507 506 WKPageMouseDidMoveOverElementCallback mouseDidMoveOverElement; 508 507 WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest; … … 513 512 WKPageHideColorPickerCallback hideColorPicker; 514 513 WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked; 515 } WKPageUIClient WK_C_DEPRECATED("Use an explicit versioned struct instead"); 514 515 // Version 3. 516 WKPagePinnedStateDidChangeCallback pinnedStateDidChange; 517 518 // Version 4. 519 WKPageDidBeginTrackingPotentialLongMousePressCallback didBeginTrackingPotentialLongMousePress; 520 WKPageDidRecognizeLongMousePressCallback didRecognizeLongMousePress; 521 WKPageDidCancelTrackingPotentialLongMousePressCallback didCancelTrackingPotentialLongMousePress; 522 WKPageIsPlayingAudioDidChangeCallback isPlayingAudioDidChange; 523 524 // Version 5. 525 WKPageDecidePolicyForUserMediaPermissionRequestCallback decidePolicyForUserMediaPermissionRequest; 526 WKPageDidClickAutoFillButtonCallback didClickAutoFillButton; 527 WKPageRunJavaScriptAlertCallback runJavaScriptAlert; 528 WKPageRunJavaScriptConfirmCallback runJavaScriptConfirm; 529 WKPageRunJavaScriptPromptCallback runJavaScriptPrompt; 530 WKPageMediaSessionMetadataDidChangeCallback mediaSessionMetadataDidChange; 531 532 // Version 6. 533 WKPageCreateNewPageCallback createNewPage; 534 535 } WKPageUIClientV6; 516 536 517 537 #ifdef __cplusplus -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.cpp
r194075 r194076 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "WKWindowFeatures.h" 26 #include "config.h" 27 #include "WKWindowFeaturesRef.h" 27 28 28 #if WK_API_ENABLED 29 #include "APIWindowFeatures.h" 30 #include "WKAPICast.h" 29 31 30 namespace WebCore { 31 struct WindowFeatures; 32 WKTypeID WKWindowFeaturesGetTypeID() 33 { 34 return WebKit::toAPI(API::WindowFeatures::APIType); 32 35 } 33 34 @interface WKWindowFeatures ()35 36 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures;37 38 @end39 40 #endif -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKWindowFeaturesRef.h
r194075 r194076 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "WKWindowFeatures.h" 26 #ifndef WKWindowFeaturesRef_h 27 #define WKWindowFeaturesRef_h 27 28 28 #i f WK_API_ENABLED29 #include <WebKit/WKBase.h> 29 30 30 namespace WebCore { 31 struct WindowFeatures; 31 #ifdef __cplusplus 32 extern "C" { 33 #endif 34 35 WK_EXPORT WKTypeID WKWindowFeaturesGetTypeID(); 36 37 #ifdef __cplusplus 32 38 } 39 #endif 33 40 34 @interface WKWindowFeatures () 35 36 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures; 37 38 @end 39 40 #endif 41 #endif // WKWindowFeaturesRef_h -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.mm
r194075 r194076 32 32 #import <wtf/RetainPtr.h> 33 33 34 @implementation WKWindowFeatures { 35 RetainPtr<NSNumber> _menuBarVisibility; 36 RetainPtr<NSNumber> _statusBarVisibility; 37 RetainPtr<NSNumber> _toolbarsVisibility; 34 @implementation WKWindowFeatures 38 35 39 RetainPtr<NSNumber> _allowsResizing; 36 - (void)dealloc 37 { 38 _windowFeatures->API::WindowFeatures::~WindowFeatures(); 40 39 41 RetainPtr<NSNumber> _x; 42 RetainPtr<NSNumber> _y; 43 RetainPtr<NSNumber> _width; 44 RetainPtr<NSNumber> _height; 45 } 46 47 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures 48 { 49 if (!(self = [super init])) 50 return nil; 51 52 // FIXME: These should be set to nil if the features didn't exist in the string. 53 _menuBarVisibility = @(windowFeatures.menuBarVisible); 54 _statusBarVisibility = @(windowFeatures.statusBarVisible); 55 _toolbarsVisibility = @(windowFeatures.toolBarVisible || windowFeatures.locationBarVisible); 56 _allowsResizing = @(windowFeatures.resizable); 57 58 if (windowFeatures.x) 59 _x = @(*windowFeatures.x); 60 if (windowFeatures.y) 61 _y = @(*windowFeatures.y); 62 if (windowFeatures.width) 63 _width = @(*windowFeatures.width); 64 if (windowFeatures.height) 65 _height = @(*windowFeatures.height); 66 67 return self; 40 [super dealloc]; 68 41 } 69 42 70 43 - (NSNumber *)menuBarVisibility 71 44 { 72 return _menuBarVisibility.get();45 return @(_windowFeatures->windowFeatures().menuBarVisible); 73 46 } 74 47 75 48 - (NSNumber *)statusBarVisibility 76 49 { 77 return _statusBarVisibility.get();50 return @(_windowFeatures->windowFeatures().statusBarVisible); 78 51 } 79 52 80 53 - (NSNumber *)toolbarsVisibility 81 54 { 82 return _toolbarsVisibility.get();55 return @(_windowFeatures->windowFeatures().toolBarVisible); 83 56 } 84 57 85 58 - (NSNumber *)allowsResizing 86 59 { 87 return _allowsResizing.get();60 return @(_windowFeatures->windowFeatures().resizable); 88 61 } 89 62 90 63 - (NSNumber *)x 91 64 { 92 return _x.get(); 65 if (auto x = _windowFeatures->windowFeatures().x) 66 return @(*x); 67 68 return nil; 93 69 } 94 70 95 71 - (NSNumber *)y 96 72 { 97 return _y.get(); 73 if (auto y = _windowFeatures->windowFeatures().y) 74 return @(*y); 75 76 return nil; 98 77 } 99 78 100 79 - (NSNumber *)width 101 80 { 102 return _width.get(); 81 if (auto width = _windowFeatures->windowFeatures().width) 82 return @(*width); 83 84 return nil; 103 85 } 104 86 105 87 - (NSNumber *)height 106 88 { 107 return _height.get(); 89 if (auto height = _windowFeatures->windowFeatures().height) 90 return @(*height); 91 92 return nil; 93 } 94 95 #pragma mark WKObject protocol implementation 96 97 - (API::Object&)_apiObject 98 { 99 return *_windowFeatures; 108 100 } 109 101 -
branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h
r166244 r194076 28 28 #if WK_API_ENABLED 29 29 30 namespace WebCore { 31 struct WindowFeatures; 30 #import "APIWindowFeatures.h" 31 #import "WKObject.h" 32 33 namespace WebKit { 34 35 inline WKWindowFeatures *wrapper(API::WindowFeatures& windowFeatures) 36 { 37 ASSERT([windowFeatures.wrapper() isKindOfClass:[WKWindowFeatures class]]); 38 39 return (WKWindowFeatures *)windowFeatures.wrapper(); 32 40 } 33 41 34 @interface WKWindowFeatures () 35 36 - (instancetype)_initWithWindowFeatures:(const WebCore::WindowFeatures&)windowFeatures; 37 42 } 43 @interface WKWindowFeatures () <WKObject> { 44 @package 45 API::ObjectStorage<API::WindowFeatures> _windowFeatures; 46 } 38 47 @end 39 48 -
branches/safari-601-branch/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
r187390 r194076 115 115 116 116 bool shouldOpenAppLinks = !protocolHostAndPortAreEqual(WebCore::URL(WebCore::ParsedURLString, initiatingFrame->url()), request.url()); 117 auto navigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, request, WebCore::URL(), shouldOpenAppLinks); 118 119 RetainPtr<WKWebView> webView = [delegate.get() webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(navigationAction) windowFeatures:adoptNS([[WKWindowFeatures alloc] _initWithWindowFeatures:windowFeatures]).get()]; 117 auto apiNavigationAction = API::NavigationAction::create(navigationActionData, sourceFrameInfo.ptr(), nullptr, request, WebCore::URL(), shouldOpenAppLinks); 118 119 auto apiWindowFeatures = API::WindowFeatures::create(windowFeatures); 120 121 RetainPtr<WKWebView> webView = [delegate.get() webView:m_uiDelegate.m_webView createWebViewWithConfiguration:configuration.get() forNavigationAction:wrapper(apiNavigationAction) windowFeatures:wrapper(apiWindowFeatures)]; 120 122 121 123 if (!webView) -
branches/safari-601-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r186788 r194076 286 286 1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */; }; 287 287 1A6509CE18B4146200614332 /* WKProcessPoolPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6509CD18B4146200614332 /* WKProcessPoolPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 288 1A6563E41B7A8C50009CF787 /* APIWindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */; }; 289 1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */; }; 288 290 1A66BF8F18A052ED002071B4 /* WKWebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */; }; 289 291 1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; }; … … 301 303 1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */; }; 302 304 1A7865BA16CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */; }; 305 1A7C0DF61B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */; }; 306 1A7C0DF71B7D1F1000A9B848 /* WKWindowFeaturesRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C0DF51B7D1F1000A9B848 /* WKWindowFeaturesRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; 303 307 1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */; }; 304 308 1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */; }; … … 2382 2386 1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UpdateInfo.cpp; sourceTree = "<group>"; }; 2383 2387 1A6509CD18B4146200614332 /* WKProcessPoolPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessPoolPrivate.h; sourceTree = "<group>"; }; 2388 1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIWindowFeatures.cpp; sourceTree = "<group>"; }; 2389 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIWindowFeatures.h; sourceTree = "<group>"; }; 2384 2390 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewInternal.h; sourceTree = "<group>"; }; 2385 2391 1A6D141F1B0167D500785FF0 /* Info-OSX-10.9-10.10.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-OSX-10.9-10.10.plist"; sourceTree = "<group>"; }; … … 2400 2406 1A7865B716CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessConnectionManagerMessageReceiver.cpp; sourceTree = "<group>"; }; 2401 2407 1A7865B816CAC71500ACE83A /* PluginProcessConnectionManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessConnectionManagerMessages.h; sourceTree = "<group>"; }; 2408 1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWindowFeaturesRef.cpp; sourceTree = "<group>"; }; 2409 1A7C0DF51B7D1F1000A9B848 /* WKWindowFeaturesRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWindowFeaturesRef.h; sourceTree = "<group>"; }; 2402 2410 1A7C6CD81378950800B9C04D /* EnvironmentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnvironmentVariables.cpp; sourceTree = "<group>"; }; 2403 2411 1A7C6CD91378950800B9C04D /* EnvironmentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EnvironmentVariables.h; sourceTree = "<group>"; }; … … 6249 6257 1A3635A71A3144A300ED6197 /* APIWebsiteDataStore.cpp */, 6250 6258 1A3635A81A3144A300ED6197 /* APIWebsiteDataStore.h */, 6259 1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */, 6260 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */, 6251 6261 ); 6252 6262 path = API; … … 6382 6392 1A57109C1ABA0027002FABBE /* WKWebsiteDataStoreRef.cpp */, 6383 6393 1A57109D1ABA0027002FABBE /* WKWebsiteDataStoreRef.h */, 6394 1A7C0DF41B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp */, 6395 1A7C0DF51B7D1F1000A9B848 /* WKWindowFeaturesRef.h */, 6384 6396 ); 6385 6397 path = C; … … 8045 8057 1A4832D11A9BDC2F008B4DFE /* WebsiteDataRecord.h in Headers */, 8046 8058 1A53C2AA1A325730004E8C70 /* WebsiteDataStore.h in Headers */, 8059 1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */, 8047 8060 836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */, 8048 8061 1A52C0F81A38CDC70016160A /* WebStorageNamespaceProvider.h in Headers */, … … 8170 8183 C54256BA18BEC18C00DE4179 /* WKFormSelectControl.h in Headers */, 8171 8184 BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */, 8185 1A7C0DF71B7D1F1000A9B848 /* WKWindowFeaturesRef.h in Headers */, 8172 8186 37DFA7001810BB92001F4A9F /* WKFoundation.h in Headers */, 8173 8187 BCD0139B110FA420003B8A67 /* WKFrame.h in Headers */, … … 9362 9376 7C89D2A61A6789EA003A5FDE /* APIUserScript.cpp in Sources */, 9363 9377 C5E1AFEC16B21012006CC1F2 /* APIWebArchive.mm in Sources */, 9378 1A7C0DF61B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp in Sources */, 9364 9379 C5E1AFEE16B21025006CC1F2 /* APIWebArchiveResource.mm in Sources */, 9365 9380 1A4832C71A9BC13C008B4DFE /* APIWebsiteDataRecord.cpp in Sources */, … … 10026 10041 BC407601124FF0270068F20A /* WKNumber.cpp in Sources */, 10027 10042 7CD5EBB81746A15B000C1C45 /* WKObjCTypeWrapperRef.mm in Sources */, 10043 1A6563E41B7A8C50009CF787 /* APIWindowFeatures.cpp in Sources */, 10028 10044 374436881820E7240049579F /* WKObject.mm in Sources */, 10029 10045 BC85806312B8505700EDEB2E /* WKOpenPanelParameters.cpp in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.