Changeset 243173 in webkit
- Timestamp:
- Mar 19, 2019, 3:11:00 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 6 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/en.lproj/Localizable.strings (modified) (3 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/Cocoa/UIDelegate.h (modified) (1 diff)
-
WebKit/UIProcess/Cocoa/UIDelegate.mm (modified) (2 diffs)
-
WebKit/UIProcess/Cocoa/WKStorageAccessAlert.h (added)
-
WebKit/UIProcess/Cocoa/WKStorageAccessAlert.mm (added)
-
WebKit/WebKit.xcodeproj/project.pbxproj (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243170 r243173 1 2019-03-19 Brent Fulgham <bfulgham@apple.com> 2 3 Add default prompt implementation for the Storage Access API 4 https://bugs.webkit.org/show_bug.cgi?id=195866 5 <rdar://problem/45150009> 6 7 Reviewed by Chris Dumez. 8 9 * en.lproj/Localizable.strings: Update with new strings used by the 10 Storage Access API dialog. 11 1 12 2019-03-19 Thibault Saunier <tsaunier@igalia.com> 2 13 -
trunk/Source/WebCore/en.lproj/Localizable.strings
r243113 r243173 104 104 "Align Right (Undo action name)" = "Align Right"; 105 105 106 /* Allow Storage Access API */ 107 "Allow" = "Allow"; 108 109 /* Title for Allow button label in the Storage Access API request dialog */ 110 "Allow (cross-site cookie and website data access)" = "Allow"; 111 112 /* Storage Access API request validation (iOS phrasing) */ 113 "Allow \"%@\" to use cookies and website data while browsing \"%@\"?" = "Allow \"%@\" to use cookies and website data while browsing \"%@\"?"; 114 106 115 /* WKErrorUnknown description */ 107 116 "An unknown error occurred" = "An unknown error occurred"; … … 248 257 "Dictation (Undo action name)" = "Dictation"; 249 258 259 /* Storage Access API request validation (macOS phrasing) */ 260 "Do you want to allow \"%@\" to use cookies and website data while browsing \"%@\"?" = "Do you want to allow \"%@\" to use cookies and website data while browsing \"%@\"?"; 261 262 /* Storage Access API deny access */ 263 "Don't Allow" = "Don't Allow"; 264 265 /* Title for Don't Allow button label in the Storage Access API request dialog */ 266 "Don't Allow (cross-site cookie and website data access)" = "Don't Allow"; 267 250 268 /* Title of the Done button for zoomed form controls. */ 251 269 "Done" = "Done"; … … 803 821 "This website may try to trick you into installing software that harms your browsing experience, like changing your settings without your permission or showing you unwanted ads. Once installed, it may be difficult to remove." = "This website may try to trick you into installing software that harms your browsing experience, like changing your settings without your permission or showing you unwanted ads. Once installed, it may be difficult to remove."; 804 822 823 /* Storage Access API tracking warning */ 824 "This will allow \"%@\" to track your activity." = "This will allow \"%@\" to track your activity."; 825 805 826 /* Undo action name */ 806 827 "Tighten Kerning (Undo action name)" = "Tighten Kerning"; -
trunk/Source/WebKit/ChangeLog
r243168 r243173 1 2019-03-19 Brent Fulgham <bfulgham@apple.com> 2 3 Add default prompt implementation for the Storage Access API 4 https://bugs.webkit.org/show_bug.cgi?id=195866 5 <rdar://problem/45150009> 6 7 Reviewed by Chris Dumez. 8 9 This patch revises the UIDelegate implementation with a default permission dialog 10 for the Storage Access API. This allows us to use and test the API in MiniBrowser, 11 rather than requiring a full-fledged web browser to drive testing. 12 13 * UIProcess/Cocoa/UIDelegate.h: 14 * UIProcess/Cocoa/UIDelegate.mm: 15 (WebKit::UIDelegate::UIClient::presentStorageAccessConfirmDialog): Added. 16 (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): Modify to call new default 17 implementation if the WKWebVIew client doesn't implement the necessary SPI. 18 * UIProcess/Cocoa/WKStorageAccessAlert.h: Added. 19 * UIProcess/Cocoa/WKStorageAccessAlert.mm: Added. 20 (WebKit::presentStorageAccessAlert): 21 * WebKit.xcodeproj/project.pbxproj: 22 1 23 2019-03-19 Conrad Shultz <conrad_shultz@apple.com> 2 24 -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
r242760 r243173 88 88 void runJavaScriptConfirm(WebPageProxy*, const WTF::String&, WebFrameProxy*, const WebCore::SecurityOriginData&, Function<void(bool)>&& completionHandler) final; 89 89 void runJavaScriptPrompt(WebPageProxy*, const WTF::String&, const WTF::String&, WebFrameProxy*, const WebCore::SecurityOriginData&, Function<void(const WTF::String&)>&&) final; 90 void presentStorageAccessConfirmDialog(const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler<void(bool)>&&); 90 91 void requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler<void(bool)>&&) final; 91 92 void decidePolicyForGeolocationPermissionRequest(WebPageProxy&, WebFrameProxy&, API::SecurityOrigin&, Function<void(bool)>&) final; -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
r242823 r243173 41 41 #import "WKOpenPanelParametersInternal.h" 42 42 #import "WKSecurityOriginInternal.h" 43 #import "WKStorageAccessAlert.h" 43 44 #import "WKUIDelegatePrivate.h" 44 45 #import "WKWebViewConfigurationInternal.h" … … 339 340 void UIDelegate::UIClient::requestStorageAccessConfirm(WebPageProxy&, WebFrameProxy*, const WTF::String& requestingDomain, const WTF::String& currentDomain, CompletionHandler<void(bool)>&& completionHandler) 340 341 { 342 auto delegate = m_uiDelegate.m_delegate.get(); 343 if (!delegate) { 344 completionHandler(false); 345 return; 346 } 347 341 348 if (!m_uiDelegate.m_delegateMethods.webViewRequestStorageAccessPanelForTopPrivatelyControlledDomainUnderFirstPartyTopPrivatelyControlledDomainCompletionHandler) { 342 completionHandler(true); 343 return; 344 } 345 346 auto delegate = m_uiDelegate.m_delegate.get(); 347 if (!delegate) { 348 completionHandler(true); 349 return; 350 } 351 349 presentStorageAccessAlert(m_uiDelegate.m_webView, requestingDomain, currentDomain, WTFMove(completionHandler)); 350 return; 351 } 352 352 353 auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:requestStorageAccessPanelForDomain:underCurrentDomain:completionHandler:)); 353 354 [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView requestStorageAccessPanelForDomain:requestingDomain underCurrentDomain:currentDomain completionHandler:makeBlockPtr([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)] (BOOL result) mutable { -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r243147 r243173 1118 1118 7A41E9FB21F81DAD00B88CDB /* ShouldGrandfatherStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A41E9FA21F81DAC00B88CDB /* ShouldGrandfatherStatistics.h */; }; 1119 1119 7A772C8D1DDD4A25000F34F1 /* com.apple.WebKit.plugin-common.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */; }; 1120 7A78FF32224191960096483E /* WKStorageAccessAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A78FF2E224191750096483E /* WKStorageAccessAlert.h */; }; 1121 7A78FF332241919B0096483E /* WKStorageAccessAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */; }; 1120 1122 7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */; }; 1121 1123 7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */; }; … … 3565 3567 7A41E9FA21F81DAC00B88CDB /* ShouldGrandfatherStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShouldGrandfatherStatistics.h; path = Classifier/ShouldGrandfatherStatistics.h; sourceTree = "<group>"; }; 3566 3568 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "com.macromedia.Flash Player ESR.plugin.sb"; sourceTree = "<group>"; }; 3569 7A78FF2E224191750096483E /* WKStorageAccessAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStorageAccessAlert.h; sourceTree = "<group>"; }; 3570 7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKStorageAccessAlert.mm; sourceTree = "<group>"; }; 3567 3571 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceLoadStatisticsStoreMessages.h; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; 3568 3572 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceLoadStatisticsStoreMessageReceiver.cpp; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; … … 5398 5402 1DE0D095211CC21300439B5F /* WKShareSheet.h */, 5399 5403 1DBBB061211CC3CB00502ECC /* WKShareSheet.mm */, 5404 7A78FF2E224191750096483E /* WKStorageAccessAlert.h */, 5405 7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */, 5400 5406 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */, 5401 5407 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */, … … 9978 9984 513E462D1AD837560016234A /* WKSharingServicePickerDelegate.h in Headers */, 9979 9985 93F549B41E3174B7000E7239 /* WKSnapshotConfiguration.h in Headers */, 9986 7A78FF32224191960096483E /* WKStorageAccessAlert.h in Headers */, 9980 9987 BC407606124FF0270068F20A /* WKString.h in Headers */, 9981 9988 BC40761A124FF0370068F20A /* WKStringCF.h in Headers */, … … 11181 11188 5CA26D83217AD1B800F97A35 /* WKSafeBrowsingWarning.mm in Sources */, 11182 11189 1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */, 11190 7A78FF332241919B0096483E /* WKStorageAccessAlert.mm in Sources */, 11183 11191 26F10BE919187E2E001D0E68 /* WKSyntheticTapGestureRecognizer.m in Sources */, 11184 11192 );
Note:
See TracChangeset
for help on using the changeset viewer.