Changeset 199557 in webkit
- Timestamp:
- Apr 14, 2016 2:54:13 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 27 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r199554 r199557 1 2016-04-14 Jiewen Tan <jiewen_tan@apple.com> 2 3 Unreviewed, rolling out r199554. 4 5 The change breaks Yosemite Release/Debug build 6 7 Reverted changeset: 8 9 "[Mac] Add API for open panel handling to WKWebView" 10 https://bugs.webkit.org/show_bug.cgi?id=137759 11 http://trac.webkit.org/changeset/199554 12 1 13 2016-04-14 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Source/WebKit2/Shared/API/Cocoa/WebKit.h
r199554 r199557 34 34 #import <WebKit/WKNavigationDelegate.h> 35 35 #import <WebKit/WKNavigationResponse.h> 36 #import <WebKit/WKOpenPanelParameters.h>37 36 #import <WebKit/WKPreferences.h> 38 37 #import <WebKit/WKPreviewActionItem.h> -
trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm
r199554 r199557 47 47 #import "WKNavigationInternal.h" 48 48 #import "WKNavigationResponseInternal.h" 49 #import "WKOpenPanelParametersInternal.h"50 49 #import "WKPreferencesInternal.h" 51 50 #import "WKProcessPoolInternal.h" … … 183 182 break; 184 183 185 case Type::OpenPanelParameters:186 wrapper = [WKOpenPanelParameters alloc];187 break;188 189 184 case Type::PageGroup: 190 185 wrapper = [WKBrowsingContextGroup alloc]; -
trunk/Source/WebKit2/Shared/WebOpenPanelParameters.cpp
r199556 r199557 26 26 27 27 #include "config.h" 28 #include " APIOpenPanelParameters.h"28 #include "WebOpenPanelParameters.h" 29 29 30 30 #include "APIArray.h" … … 34 34 using namespace WebCore; 35 35 36 namespace API{36 namespace WebKit { 37 37 38 Ref<OpenPanelParameters>OpenPanelParameters::create(const FileChooserSettings& settings)38 PassRefPtr<WebOpenPanelParameters> WebOpenPanelParameters::create(const FileChooserSettings& settings) 39 39 { 40 return adoptRef( *newOpenPanelParameters(settings));40 return adoptRef(new WebOpenPanelParameters(settings)); 41 41 } 42 42 43 OpenPanelParameters::OpenPanelParameters(const FileChooserSettings& settings)43 WebOpenPanelParameters::WebOpenPanelParameters(const FileChooserSettings& settings) 44 44 : m_settings(settings) 45 45 { 46 46 } 47 47 48 OpenPanelParameters::~OpenPanelParameters()48 WebOpenPanelParameters::~WebOpenPanelParameters() 49 49 { 50 50 } 51 51 52 Ref<API::Array> OpenPanelParameters::acceptMIMETypes() const52 Ref<API::Array> WebOpenPanelParameters::acceptMIMETypes() const 53 53 { 54 54 return API::Array::createStringArray(m_settings.acceptMIMETypes); … … 56 56 57 57 #if ENABLE(MEDIA_CAPTURE) 58 bool OpenPanelParameters::capture() const58 bool WebOpenPanelParameters::capture() const 59 59 { 60 60 return m_settings.capture; … … 62 62 #endif 63 63 64 Ref<API::Array> OpenPanelParameters::selectedFileNames() const64 Ref<API::Array> WebOpenPanelParameters::selectedFileNames() const 65 65 { 66 66 return API::Array::createStringArray(m_settings.selectedFiles); -
trunk/Source/WebKit2/Shared/WebOpenPanelParameters.h
r199556 r199557 25 25 */ 26 26 27 #pragma once 27 #ifndef WebOpenPanelParameters_h 28 #define WebOpenPanelParameters_h 28 29 29 30 #include "APIObject.h" 30 31 #include <WebCore/FileChooser.h> 32 #include <wtf/Vector.h> 33 #include <wtf/text/WTFString.h> 31 34 32 35 namespace API { 36 class Array; 37 } 33 38 34 class Array; 39 namespace WebKit { 35 40 36 class OpenPanelParameters : public API::ObjectImpl<API::Object::Type::OpenPanelParameters> {41 class WebOpenPanelParameters : public API::ObjectImpl<API::Object::Type::OpenPanelParameters> { 37 42 public: 38 static Ref<OpenPanelParameters> create(const WebCore::FileChooserSettings&);39 ~ OpenPanelParameters();43 static PassRefPtr<WebOpenPanelParameters> create(const WebCore::FileChooserSettings&); 44 ~WebOpenPanelParameters(); 40 45 41 46 bool allowMultipleFiles() const { return m_settings.allowsMultipleFiles; } … … 47 52 48 53 private: 49 explicit OpenPanelParameters(const WebCore::FileChooserSettings&);54 explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&); 50 55 51 56 WebCore::FileChooserSettings m_settings; 52 57 }; 53 58 54 } // namespace API 59 } // namespace WebKit 60 61 #endif // WebOpenPanelParameters_h -
trunk/Source/WebKit2/UIProcess/API/APIUIClient.h
r199554 r199557 56 56 class WebColorPickerResultListenerProxy; 57 57 class WebFrameProxy; 58 class WebOpenPanelParameters; 58 59 class WebOpenPanelResultListenerProxy; 59 60 class WebPageProxy; … … 70 71 class Dictionary; 71 72 class Object; 72 class OpenPanelParameters;73 73 class SecurityOrigin; 74 74 … … 131 131 } 132 132 133 virtual bool runOpenPanel(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, const WebCore::SecurityOriginData&,OpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*) { return false; }133 virtual bool runOpenPanel(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebOpenPanelParameters*, WebKit::WebOpenPanelResultListenerProxy*) { return false; } 134 134 virtual bool decidePolicyForGeolocationPermissionRequest(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, SecurityOrigin*, WebKit::GeolocationPermissionRequestProxy*) { return false; } 135 135 virtual bool decidePolicyForUserMediaPermissionRequest(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, SecurityOrigin&, SecurityOrigin&, WebKit::UserMediaPermissionRequestProxy&) { return false; } -
trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h
r199554 r199557 59 59 class NavigationData; 60 60 class NavigationResponse; 61 class OpenPanelParameters;62 61 class PageConfiguration; 63 62 class ProcessPoolConfiguration; … … 99 98 class WebNotificationManagerProxy; 100 99 class WebNotificationProvider; 100 class WebOpenPanelParameters; 101 101 class WebOpenPanelResultListenerProxy; 102 102 class WebPageGroup; … … 147 147 WK_ADD_API_MAPPING(WKNotificationProviderRef, WebNotificationProvider) 148 148 WK_ADD_API_MAPPING(WKNotificationRef, WebNotification) 149 WK_ADD_API_MAPPING(WKOpenPanelParametersRef, API::OpenPanelParameters)149 WK_ADD_API_MAPPING(WKOpenPanelParametersRef, WebOpenPanelParameters) 150 150 WK_ADD_API_MAPPING(WKOpenPanelResultListenerRef, WebOpenPanelResultListenerProxy) 151 151 WK_ADD_API_MAPPING(WKPageGroupRef, WebPageGroup) -
trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParametersRef.cpp
r199554 r199557 29 29 30 30 #include "APIArray.h" 31 #include "APIOpenPanelParameters.h"32 31 #include "WKAPICast.h" 32 #include "WebOpenPanelParameters.h" 33 33 34 34 using namespace WebKit; … … 36 36 WKTypeID WKOpenPanelParametersGetTypeID() 37 37 { 38 return toAPI( API::OpenPanelParameters::APIType);38 return toAPI(WebOpenPanelParameters::APIType); 39 39 } 40 40 -
trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelResultListener.cpp
r199554 r199557 29 29 #include "WKAPICast.h" 30 30 #include "WebOpenPanelResultListenerProxy.h" 31 #include <WebCore/URL.h>32 31 33 32 using namespace WebKit; … … 38 37 } 39 38 40 static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs)41 {42 Vector<String> filePaths;43 44 size_t size = fileURLs.size();45 filePaths.reserveInitialCapacity(size);46 47 for (size_t i = 0; i < size; ++i) {48 API::URL* apiURL = fileURLs.at<API::URL>(i);49 if (apiURL)50 filePaths.uncheckedAppend(WebCore::URL(WebCore::URL(), apiURL->string()).fileSystemPath());51 }52 53 return filePaths;54 }55 56 39 void WKOpenPanelResultListenerChooseFiles(WKOpenPanelResultListenerRef listenerRef, WKArrayRef fileURLsRef) 57 40 { 58 toImpl(listenerRef)->chooseFiles( filePathsFromFileURLs(*toImpl(fileURLsRef)));41 toImpl(listenerRef)->chooseFiles(toImpl(fileURLsRef)); 59 42 } 60 43 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r199554 r199557 41 41 #include "APINavigationClient.h" 42 42 #include "APINavigationResponse.h" 43 #include "APIOpenPanelParameters.h"44 43 #include "APIPageConfiguration.h" 45 44 #include "APIPolicyClient.h" … … 63 62 #include "WebImage.h" 64 63 #include "WebInspectorProxy.h" 64 #include "WebOpenPanelParameters.h" 65 65 #include "WebOpenPanelResultListenerProxy.h" 66 66 #include "WebPageGroup.h" … … 2054 2054 } 2055 2055 2056 bool runOpenPanel(WebPageProxy* page, WebFrameProxy* frame, const WebCore::SecurityOriginData&, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override2056 bool runOpenPanel(WebPageProxy* page, WebFrameProxy* frame, WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) override 2057 2057 { 2058 2058 if (!m_client.runOpenPanel) -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegate.h
r199554 r199557 35 35 @class WKFrameInfo; 36 36 @class WKNavigationAction; 37 @class WKOpenPanelParameters;38 37 @class WKPreviewElementInfo; 39 38 @class WKWebViewConfiguration; … … 145 144 if a non-nil view controller was returned. 146 145 */ 147 - (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray <id <WKPreviewActionItem>> *)previewActions WK_AVAILABLE(NA, WK_IOS_TBA);146 - (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray <id <WKPreviewActionItem>> *)previewActions WK_AVAILABLE(NA, WK_IOS_TBA); 148 147 149 148 /*! @abstract Allows your app to pop to the view controller it created. … … 155 154 #endif // TARGET_OS_IPHONE 156 155 157 #if !TARGET_OS_IPHONE158 159 /*! @abstract Displays a file upload panel.160 @param webView The web view invoking the delegate method.161 @param parameters Parameters describing the file upload control.162 @param frame Information about the frame whose file upload control initiated this call.163 @param completionHandler The completion handler to call after open panel has been dismissed. Pass the selected URLs if the user chose OK, otherwise nil.164 165 If you do not implement this method, the web view will behave as if the user selected the Cancel button.166 */167 - (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * WK_NULLABLE_SPECIFIER URLs))completionHandler WK_AVAILABLE(WK_MAC_TBA, NA);168 169 #endif170 171 156 @end 172 157 -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
r199554 r199557 87 87 void exceededDatabaseQuota(WebPageProxy*, WebFrameProxy*, API::SecurityOrigin*, const WTF::String& databaseName, const WTF::String& displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentUsage, unsigned long long expectedUsage, std::function<void (unsigned long long)>) override; 88 88 void reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin&, uint64_t currentQuota, uint64_t totalBytesNeeded, std::function<void (unsigned long long)> completionHandler) override; 89 #if PLATFORM(MAC)90 bool runOpenPanel(WebPageProxy*, WebFrameProxy*, const WebCore::SecurityOriginData&, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;91 #endif92 89 void printFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*) override; 93 90 #if PLATFORM(IOS) … … 112 109 bool webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler : 1; 113 110 bool webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler : 1; 114 #if PLATFORM(MAC)115 bool webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler : 1;116 #endif117 111 bool webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler : 1; 118 112 bool webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded : 1; -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
r199554 r199557 33 33 #import "WKFrameInfoInternal.h" 34 34 #import "WKNavigationActionInternal.h" 35 #import "WKOpenPanelParametersInternal.h"36 35 #import "WKSecurityOriginInternal.h" 37 36 #import "WKWebViewConfigurationInternal.h" … … 39 38 #import "WKWindowFeaturesInternal.h" 40 39 #import "WKUIDelegatePrivate.h" 41 #import "WebOpenPanelResultListenerProxy.h"42 40 #import "_WKContextMenuElementInfo.h" 43 41 #import "_WKFrameHandleInternal.h" … … 81 79 m_delegateMethods.webViewRunJavaScriptConfirmPanelWithMessageInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)]; 82 80 m_delegateMethods.webViewRunJavaScriptTextInputPanelWithPromptDefaultTextInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)]; 83 84 #if PLATFORM(MAC)85 m_delegateMethods.webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler = [delegate respondsToSelector:@selector(webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:)];86 #endif87 88 81 m_delegateMethods.webViewDecideDatabaseQuotaForSecurityOriginCurrentQuotaCurrentOriginUsageCurrentDatabaseUsageExpectedUsageDecisionHandler = [delegate respondsToSelector:@selector(_webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:)]; 89 82 m_delegateMethods.webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded = [delegate respondsToSelector:@selector(_webView:decideWebApplicationCacheQuotaForSecurityOrigin:currentQuota:totalBytesNeeded:decisionHandler:)]; … … 258 251 } 259 252 260 #if PLATFORM(MAC)261 bool UIDelegate::UIClient::runOpenPanel(WebPageProxy*, WebFrameProxy* webFrameProxy, const WebCore::SecurityOriginData& securityOriginData, API::OpenPanelParameters* openPanelParameters, WebOpenPanelResultListenerProxy* listener)262 {263 if (!m_uiDelegate.m_delegateMethods.webViewRunOpenPanelWithParametersInitiatedByFrameCompletionHandler)264 return false;265 266 auto delegate = m_uiDelegate.m_delegate.get();267 if (!delegate)268 return false;269 270 auto frame = API::FrameInfo::create(*webFrameProxy, securityOriginData.securityOrigin());271 RefPtr<WebOpenPanelResultListenerProxy> resultListener = listener;272 273 RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:));274 275 [delegate webView:m_uiDelegate.m_webView runOpenPanelWithParameters:wrapper(*openPanelParameters) initiatedByFrame:wrapper(frame) completionHandler:[checker, resultListener](NSArray<NSURL *> *URLs) {276 checker->didCallCompletionHandler();277 278 if (!URLs) {279 resultListener->cancel();280 return;281 }282 283 Vector<String> filenames;284 for (NSURL *url in URLs)285 filenames.append(url.fileSystemRepresentation);286 287 resultListener->chooseFiles(filenames);288 }];289 290 return true;291 }292 #endif293 294 253 void UIDelegate::UIClient::reachedApplicationCacheOriginQuota(WebPageProxy*, const WebCore::SecurityOrigin& securityOrigin, uint64_t currentQuota, uint64_t totalBytesNeeded, std::function<void (unsigned long long)> completionHandler) 295 254 { -
trunk/Source/WebKit2/UIProcess/PageClient.h
r199554 r199557 152 152 virtual void handleDownloadRequest(DownloadProxy*) = 0; 153 153 154 virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; }154 virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) { return false; } 155 155 156 156 virtual void didChangeContentSize(const WebCore::IntSize&) = 0; -
trunk/Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.cpp
r199554 r199557 46 46 } 47 47 48 static Vector<String> filePathsFromFileURLs(const API::Array& fileURLs) 49 { 50 Vector<String> filePaths; 51 52 size_t size = fileURLs.size(); 53 filePaths.reserveInitialCapacity(size); 54 55 for (size_t i = 0; i < size; ++i) { 56 API::URL* apiURL = fileURLs.at<API::URL>(i); 57 if (apiURL) 58 filePaths.uncheckedAppend(URL(URL(), apiURL->string()).fileSystemPath()); 59 } 60 61 return filePaths; 62 } 63 48 64 #if PLATFORM(IOS) 49 void WebOpenPanelResultListenerProxy::chooseFiles( const Vector<WTF::String>& filenames, const String&displayString, const API::Data* iconImageData)65 void WebOpenPanelResultListenerProxy::chooseFiles(API::Array* fileURLsArray, API::String* displayString, const API::Data* iconImageData) 50 66 { 51 67 if (!m_page) 52 68 return; 53 69 54 m_page->didChooseFilesForOpenPanelWithDisplayStringAndIcon(file names, displayString, iconImageData);70 m_page->didChooseFilesForOpenPanelWithDisplayStringAndIcon(filePathsFromFileURLs(*fileURLsArray), displayString ? displayString->string() : String(), iconImageData); 55 71 } 56 72 #endif 57 73 58 void WebOpenPanelResultListenerProxy::chooseFiles( const Vector<String>& filenames)74 void WebOpenPanelResultListenerProxy::chooseFiles(API::Array* fileURLsArray) 59 75 { 60 76 if (!m_page) 61 77 return; 62 78 63 m_page->didChooseFilesForOpenPanel(file names);79 m_page->didChooseFilesForOpenPanel(filePathsFromFileURLs(*fileURLsArray)); 64 80 } 65 81 -
trunk/Source/WebKit2/UIProcess/WebOpenPanelResultListenerProxy.h
r199554 r199557 28 28 29 29 #include "APIObject.h" 30 #include <wtf/Forward.h>31 30 #include <wtf/PassRefPtr.h> 32 31 #include <wtf/RefPtr.h> 33 #include <wtf/Vector.h>34 32 35 33 namespace API { … … 53 51 54 52 #if PLATFORM(IOS) 55 void chooseFiles( const Vector<String>& filenames, const String&displayString, const API::Data* iconImageData);53 void chooseFiles(API::Array*, API::String* displayString, const API::Data* iconImageData); 56 54 #endif 57 void chooseFiles( const Vector<String>& filenames);55 void chooseFiles(API::Array*); 58 56 void cancel(); 59 57 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r199554 r199557 43 43 #include "APINavigationClient.h" 44 44 #include "APINavigationResponse.h" 45 #include "APIOpenPanelParameters.h"46 45 #include "APIPageConfiguration.h" 47 46 #include "APIPolicyClient.h" … … 92 91 #include "WebNavigationState.h" 93 92 #include "WebNotificationManagerProxy.h" 93 #include "WebOpenPanelParameters.h" 94 94 #include "WebOpenPanelResultListenerProxy.h" 95 95 #include "WebPageCreationParameters.h" … … 3854 3854 } 3855 3855 3856 void WebPageProxy::runOpenPanel(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, constFileChooserSettings& settings)3856 void WebPageProxy::runOpenPanel(uint64_t frameID, const FileChooserSettings& settings) 3857 3857 { 3858 3858 if (m_openPanelResultListener) { … … 3864 3864 MESSAGE_CHECK(frame); 3865 3865 3866 Ref <API::OpenPanelParameters> parameters = API::OpenPanelParameters::create(settings);3866 RefPtr<WebOpenPanelParameters> parameters = WebOpenPanelParameters::create(settings); 3867 3867 m_openPanelResultListener = WebOpenPanelResultListenerProxy::create(this); 3868 3868 … … 3870 3870 m_process->responsivenessTimer().stop(); 3871 3871 3872 3873 if (!m_uiClient->runOpenPanel(this, frame, frameSecurityOrigin, parameters.ptr(), m_openPanelResultListener.get())) { 3874 if (!m_pageClient.handleRunOpenPanel(this, frame, parameters.ptr(), m_openPanelResultListener.get())) 3872 if (!m_uiClient->runOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get())) { 3873 if (!m_pageClient.handleRunOpenPanel(this, frame, parameters.get(), m_openPanelResultListener.get())) 3875 3874 didCancelForOpenPanel(); 3876 3875 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r199554 r199557 1211 1211 void didChangeViewportProperties(const WebCore::ViewportAttributes&); 1212 1212 void pageDidScroll(); 1213 void runOpenPanel(uint64_t frameID, const WebCore:: SecurityOriginData&, const WebCore::FileChooserSettings&);1213 void runOpenPanel(uint64_t frameID, const WebCore::FileChooserSettings&); 1214 1214 void printFrame(uint64_t frameID); 1215 1215 void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, PassRefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r199554 r199557 72 72 RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -> (bool shouldClose) Delayed 73 73 PageDidScroll() 74 RunOpenPanel(uint64_t frameID, struct WebCore:: SecurityOriginData frameSecurityOrigin, struct WebCore::FileChooserSettings parameters)74 RunOpenPanel(uint64_t frameID, struct WebCore::FileChooserSettings parameters) 75 75 PrintFrame(uint64_t frameID) -> () 76 76 RunModal() -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
r199554 r199557 133 133 void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override; 134 134 135 bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;135 bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) override; 136 136 void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override; 137 137 double minimumZoomScale() const override; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r199554 r199557 561 561 } 562 562 563 bool PageClientImpl::handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, API::OpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener)563 bool PageClientImpl::handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters* parameters, WebOpenPanelResultListenerProxy* listener) 564 564 { 565 565 [m_contentView _showRunOpenPanel:parameters resultListener:listener]; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r199554 r199557 45 45 #import <wtf/text/WTFString.h> 46 46 47 namespace API {48 class OpenPanelParameters;49 }50 51 47 namespace WebCore { 52 48 class Color; … … 58 54 class NativeWebTouchEvent; 59 55 class SmartMagnificationController; 56 class WebOpenPanelParameters; 60 57 class WebOpenPanelResultListenerProxy; 61 58 class WebPageProxy; … … 213 210 - (void)_didUpdateBlockSelectionWithTouch:(WebKit::SelectionTouch)touch withFlags:(WebKit::SelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold; 214 211 - (void)_showPlaybackTargetPicker:(BOOL)hasVideo fromRect:(const WebCore::IntRect&)elementRect; 215 - (void)_showRunOpenPanel:( API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;212 - (void)_showRunOpenPanel:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener; 216 213 - (void)accessoryDone; 217 214 - (void)_didHandleKeyEvent:(WebIOSEvent *)event eventWasHandled:(BOOL)eventWasHandled; -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r199554 r199557 3662 3662 } 3663 3663 3664 - (void)_showRunOpenPanel:( API::OpenPanelParameters*)parameters resultListener:(WebOpenPanelResultListenerProxy*)listener3664 - (void)_showRunOpenPanel:(WebOpenPanelParameters*)parameters resultListener:(WebOpenPanelResultListenerProxy*)listener 3665 3665 { 3666 3666 ASSERT(!_fileUploadPanel); -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.h
r199554 r199557 31 31 @protocol WKFileUploadPanelDelegate; 32 32 33 namespace API {34 class OpenPanelParameters;35 }36 37 33 namespace WebKit { 34 class WebOpenPanelParameters; 38 35 class WebOpenPanelResultListenerProxy; 39 36 } … … 42 39 @property (nonatomic, assign) id <WKFileUploadPanelDelegate> delegate; 43 40 - (instancetype)initWithView:(WKContentView *)view; 44 - (void)presentWithParameters:( API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener;41 - (void)presentWithParameters:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener; 45 42 - (void)dismiss; 46 43 @end -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm
r199554 r199557 31 31 #import "APIArray.h" 32 32 #import "APIData.h" 33 #import "APIOpenPanelParameters.h"34 33 #import "APIString.h" 35 34 #import "UIKitSPI.h" … … 38 37 #import "WKStringCF.h" 39 38 #import "WKURLCF.h" 39 #import "WebOpenPanelParameters.h" 40 40 #import "WebOpenPanelResultListenerProxy.h" 41 41 #import "WebPageProxy.h" … … 334 334 } 335 335 336 Vector< String> filenames;337 filenames.reserveInitialCapacity(count);336 Vector<RefPtr<API::Object>> urls; 337 urls.reserveInitialCapacity(count); 338 338 for (NSURL *fileURL in fileURLs) 339 filenames.uncheckedAppend(fileURL.fileSystemRepresentation); 339 urls.uncheckedAppend(adoptRef(toImpl(WKURLCreateWithCFURL((CFURLRef)fileURL)))); 340 Ref<API::Array> fileURLsRef = API::Array::create(WTFMove(urls)); 340 341 341 342 NSData *jpeg = UIImageJPEGRepresentation(iconImage, 1.0); 342 343 RefPtr<API::Data> iconImageDataRef = adoptRef(toImpl(WKDataCreate(reinterpret_cast<const unsigned char*>([jpeg bytes]), [jpeg length]))); 343 344 344 _listener->chooseFiles(filenames, displayString, iconImageDataRef.get()); 345 RefPtr<API::String> displayStringRef = adoptRef(toImpl(WKStringCreateWithCFString((CFStringRef)displayString))); 346 347 _listener->chooseFiles(fileURLsRef.ptr(), displayStringRef.get(), iconImageDataRef.get()); 345 348 [self _dispatchDidDismiss]; 346 349 } … … 348 351 #pragma mark - Present / Dismiss API 349 352 350 - (void)presentWithParameters:( API::OpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener353 - (void)presentWithParameters:(WebKit::WebOpenPanelParameters*)parameters resultListener:(WebKit::WebOpenPanelResultListenerProxy*)listener 351 354 { 352 355 ASSERT(!_listener); -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r199554 r199557 286 286 1A6563E51B7A8C50009CF787 /* APIWindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */; }; 287 287 1A66BF8F18A052ED002071B4 /* WKWebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */; }; 288 1A67CD2E1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */; };289 288 1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; }; 290 289 1A6F9FB711E1408500DB1371 /* CommandLinePOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLinePOSIX.cpp */; }; … … 438 437 1AC75A1B1B3368270056745B /* HangDetectionDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */; }; 439 438 1AC75A1E1B33695E0056745B /* HangDetectionDisablerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */; }; 440 1ACC50F11CBC381D003C7D03 /* WKOpenPanelParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */; };441 1ACC50F21CBC381D003C7D03 /* WKOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */; settings = {ATTRIBUTES = (Public, ); }; };442 439 1ACC87BA1981C341003D1AF4 /* WKNavigationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 443 440 1ACECD2417162DB1001FC9EF /* StorageAreaMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */; }; … … 1508 1505 BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857F8312B82D0B00EDEB2E /* WebOpenPanelResultListener.h */; }; 1509 1506 BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857F8412B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp */; }; 1510 BC857FB512B830E600EDEB2E /* APIOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */; };1511 BC857FB612B830E600EDEB2E /* APIOpenPanelParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */; };1507 BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */; }; 1508 BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */; }; 1512 1509 BC857FE612B843D800EDEB2E /* WKOpenPanelParametersRef.h in Headers */ = {isa = PBXBuildFile; fileRef = BC857FE412B843D800EDEB2E /* WKOpenPanelParametersRef.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1513 1510 BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1DFE8E12B31CA8005DF730 /* WKOpenPanelResultListener.cpp */; }; … … 2234 2231 1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIWindowFeatures.h; sourceTree = "<group>"; }; 2235 2232 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewInternal.h; sourceTree = "<group>"; }; 2236 1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParametersInternal.h; sourceTree = "<group>"; };2237 2233 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>"; }; 2238 2234 1A6D14211B01681600785FF0 /* PluginService.32-64-10.9-10.10.Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "PluginService.32-64-10.9-10.10.Info.plist"; path = "PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist"; sourceTree = SOURCE_ROOT; }; … … 2409 2405 1AC75A1A1B3368270056745B /* HangDetectionDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HangDetectionDisabler.h; sourceTree = "<group>"; }; 2410 2406 1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HangDetectionDisablerMac.mm; sourceTree = "<group>"; }; 2411 1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKOpenPanelParameters.mm; sourceTree = "<group>"; };2412 1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParameters.h; sourceTree = "<group>"; };2413 2407 1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationPrivate.h; sourceTree = "<group>"; }; 2414 2408 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMap.cpp; sourceTree = "<group>"; }; … … 3570 3564 BC857F8312B82D0B00EDEB2E /* WebOpenPanelResultListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebOpenPanelResultListener.h; sourceTree = "<group>"; }; 3571 3565 BC857F8412B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebOpenPanelResultListener.cpp; sourceTree = "<group>"; }; 3572 BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIOpenPanelParameters.h; sourceTree = "<group>"; };3573 BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIOpenPanelParameters.cpp; sourceTree = "<group>"; };3566 BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebOpenPanelParameters.h; sourceTree = "<group>"; }; 3567 BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebOpenPanelParameters.cpp; sourceTree = "<group>"; }; 3574 3568 BC857FE412B843D800EDEB2E /* WKOpenPanelParametersRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOpenPanelParametersRef.h; sourceTree = "<group>"; }; 3575 3569 BC857FE512B843D800EDEB2E /* WKOpenPanelParametersRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKOpenPanelParametersRef.cpp; sourceTree = "<group>"; }; … … 4519 4513 C0337DAF127A28D0008FF4F4 /* WebMouseEvent.cpp */, 4520 4514 BCF69F981176CED600471A52 /* WebNavigationDataStore.h */, 4515 BC857FB412B830E600EDEB2E /* WebOpenPanelParameters.cpp */, 4516 BC857FB312B830E600EDEB2E /* WebOpenPanelParameters.h */, 4521 4517 C06C6093124C14430001682F /* WebPageCreationParameters.cpp */, 4522 4518 C06C6094124C14430001682F /* WebPageCreationParameters.h */, … … 5141 5137 1AD60F5B18E20F4C0020C034 /* WKWindowFeatures.mm */, 5142 5138 1AD60F5F18E20F740020C034 /* WKWindowFeaturesInternal.h */, 5143 1ACC50EF1CBC381D003C7D03 /* WKOpenPanelParameters.mm */,5144 1ACC50F01CBC381D003C7D03 /* WKOpenPanelParameters.h */,5145 1A67CD2D1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h */,5146 5139 ); 5147 5140 path = Cocoa; … … 5990 5983 99C81D5B1C20E817005C4C82 /* APIAutomationClient.h */, 5991 5984 990D28B31C6526D400986977 /* APIAutomationSessionClient.h */, 5992 BC857FB412B830E600EDEB2E /* APIOpenPanelParameters.cpp */,5993 BC857FB312B830E600EDEB2E /* APIOpenPanelParameters.h */,5994 5985 076E884D1A13CADF005E90FC /* APIContextMenuClient.h */, 5995 5986 83891B621A68B3420030F386 /* APIDiagnosticLoggingClient.h */, … … 7357 7348 A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */, 7358 7349 1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */, 7359 1ACC50F21CBC381D003C7D03 /* WKOpenPanelParameters.h in Headers */,7360 7350 1AD25E96167AB08100EA9BCD /* DownloadProxyMap.h in Headers */, 7361 7351 1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */, … … 7718 7708 31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */, 7719 7709 31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */, 7720 BC857FB512B830E600EDEB2E /* APIOpenPanelParameters.h in Headers */,7710 BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */, 7721 7711 BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */, 7722 7712 BC1DFEA412B31F87005DF730 /* WebOpenPanelResultListenerProxy.h in Headers */, … … 7835 7825 51A728DE1B1BAD3800102EEE /* WKBundleNavigationActionPrivate.h in Headers */, 7836 7826 BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */, 7837 1A67CD2E1CBC513F00BFE3EA /* WKOpenPanelParametersInternal.h in Headers */,7838 7827 BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */, 7839 7828 BC20528111C94284008F3375 /* WKBundlePage.h in Headers */, … … 9047 9036 1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */, 9048 9037 C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */, 9049 1ACC50F11CBC381D003C7D03 /* WKOpenPanelParameters.mm in Sources */,9050 9038 51217460164C20E30037A5C1 /* ShareableResource.cpp in Sources */, 9051 9039 1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */, … … 9203 9191 31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */, 9204 9192 31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */, 9205 BC857FB612B830E600EDEB2E /* APIOpenPanelParameters.cpp in Sources */,9193 BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */, 9206 9194 BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */, 9207 9195 BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r199554 r199557 44 44 #include "WebHitTestResultData.h" 45 45 #include "WebImage.h" 46 #include "WebOpenPanelParameters.h" 46 47 #include "WebOpenPanelResultListener.h" 47 48 #include "WebPage.h" … … 718 719 ASSERT(webFrame); 719 720 720 m_page->send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), SecurityOriginData::fromFrame(frame),fileChooser->settings()));721 m_page->send(Messages::WebPageProxy::RunOpenPanel(webFrame->frameID(), fileChooser->settings())); 721 722 } 722 723 -
trunk/Tools/ChangeLog
r199554 r199557 1 2016-04-14 Jiewen Tan <jiewen_tan@apple.com> 2 3 Unreviewed, rolling out r199554. 4 5 The change breaks Yosemite Release/Debug build 6 7 Reverted changeset: 8 9 "[Mac] Add API for open panel handling to WKWebView" 10 https://bugs.webkit.org/show_bug.cgi?id=137759 11 http://trac.webkit.org/changeset/199554 12 1 13 2016-04-14 Anders Carlsson <andersca@apple.com> 2 14 -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r199554 r199557 449 449 } 450 450 451 - (void)webView:(WKWebView *)webView runOpenPanelWithParameters:(WKOpenPanelParameters *)parameters initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(NSArray<NSURL *> * _Nullable result))completionHandler452 {453 NSOpenPanel *openPanel = [NSOpenPanel openPanel];454 455 openPanel.allowsMultipleSelection = parameters.allowsMultipleSelection;456 457 [openPanel beginSheetModalForWindow:webView.window completionHandler:^(NSInteger result) {458 if (result == NSFileHandlingPanelOKButton)459 completionHandler(openPanel.URLs);460 else461 completionHandler(@[]);462 }];463 }464 465 451 - (void)updateTextFieldFromURL:(NSURL *)URL 466 452 {
Note: See TracChangeset
for help on using the changeset viewer.