Changeset 244360 in webkit
- Timestamp:
- Apr 16, 2019 3:43:55 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/en.lproj/Localizable.strings
r244205 r244360 110 110 "Allow (cross-site cookie and website data access)" = "Allow"; 111 111 112 /* Button title in Device Orientation Permission API prompt */ 113 "Allow (device motion and orientation access)" = "Allow"; 114 112 115 /* Message for requesting cross-site cookie and website data access. */ 113 116 "Allow \"%@\" to use cookies and website data while browsing \"%@\"?" = "Allow \"%@\" to use cookies and website data while browsing \"%@\"?"; … … 155 158 "Cancel" = "Cancel"; 156 159 160 /* Button title in Device Orientation Permission API prompt */ 161 "Cancel (device motion and orientation access)" = "Cancel"; 162 157 163 /* Title for Cancel button label in button bar */ 158 164 "Cancel button label in button bar" = "Cancel"; … … 968 974 "Your password will be sent unencrypted." = "Your password will be sent unencrypted."; 969 975 976 /* Message for requesting access to the device motion and orientation */ 977 "\"%@\" Would Like to Access Motion and Orientation" = "\"%@\" Would Like to Access Motion and Orientation"; 978 970 979 /* HTTP result code string */ 971 980 "accepted" = "accepted"; -
trunk/Source/WebKit/ChangeLog
r244356 r244360 1 2019-04-16 Chris Dumez <cdumez@apple.com> 2 3 Show prompt for device orientation access if the client does not implement the corresponding API delegate 4 https://bugs.webkit.org/show_bug.cgi?id=196971 5 <rdar://problem/49945840> 6 7 Reviewed by Alex Christensen. 8 9 Show prompt for device orientation access if the client does not implement the corresponding 10 API delegate, instead of rejecting access by default. 11 12 * UIProcess/Cocoa/UIDelegate.mm: 13 (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess): 14 * UIProcess/Cocoa/WKOrientationAccessAlert.h: Added. 15 * UIProcess/Cocoa/WKOrientationAccessAlert.mm: Added. 16 (WebKit::presentOrientationAccessAlert): 17 * WebKit.xcodeproj/project.pbxproj: 18 1 19 2019-04-16 Zalan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
r243210 r244360 40 40 #import "WKNavigationActionInternal.h" 41 41 #import "WKOpenPanelParametersInternal.h" 42 #import "WKOrientationAccessAlert.h" 42 43 #import "WKSecurityOriginInternal.h" 43 44 #import "WKStorageAccessAlert.h" … … 850 851 void UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess(WebKit::WebPageProxy&, WebFrameProxy& webFrameProxy, const WebCore::SecurityOriginData& securityOriginData, CompletionHandler<void(bool)>&& completionHandler) 851 852 { 852 if (!m_uiDelegate.m_delegateMethods.webViewShouldAllowDeviceOrientationAndMotionAccessRequestedByFrameDecisionHandler) 853 auto delegate = m_uiDelegate.m_delegate.get(); 854 if (!delegate) 853 855 return completionHandler(false); 854 856 855 auto delegate = m_uiDelegate.m_delegate.get(); 856 if (!delegate) 857 return completionHandler(false); 857 if (!m_uiDelegate.m_delegateMethods.webViewShouldAllowDeviceOrientationAndMotionAccessRequestedByFrameDecisionHandler) { 858 presentOrientationAccessAlert(m_uiDelegate.m_webView, securityOriginData.host, WTFMove(completionHandler)); 859 return; 860 } 858 861 859 862 auto checker = CompletionHandlerCallChecker::create(delegate.get(), @selector(_webView:shouldAllowDeviceOrientationAndMotionAccessRequestedByFrame:decisionHandler:)); -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r244288 r244360 902 902 463FD4801EB9459600A2982C /* WKProcessTerminationReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 463FD47F1EB9458400A2982C /* WKProcessTerminationReason.h */; settings = {ATTRIBUTES = (Private, ); }; }; 903 903 463FD4821EB94EC000A2982C /* ProcessTerminationReason.h in Headers */ = {isa = PBXBuildFile; fileRef = 463FD4811EB94EAD00A2982C /* ProcessTerminationReason.h */; }; 904 4657D88922664A2D005DE823 /* WKOrientationAccessAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 4657D88722664A19005DE823 /* WKOrientationAccessAlert.h */; }; 905 4657D88A22664A2F005DE823 /* WKOrientationAccessAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4657D88822664A1A005DE823 /* WKOrientationAccessAlert.mm */; }; 904 906 466BC03C1FA266DA002FA9C1 /* WebSWContextManagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */; }; 905 907 467E43E82243FF7D00B13924 /* WebProcessDataStoreParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 467E43E72243FF6D00B13924 /* WebProcessDataStoreParameters.h */; }; … … 3129 3131 4651ECE622178A850067EB95 /* WebProcessCacheCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessCacheCocoa.mm; sourceTree = "<group>"; }; 3130 3132 465250E51ECF52CD002025CB /* WebKit2InitializeCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKit2InitializeCocoa.mm; sourceTree = "<group>"; }; 3133 4657D88722664A19005DE823 /* WKOrientationAccessAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKOrientationAccessAlert.h; sourceTree = "<group>"; }; 3134 4657D88822664A1A005DE823 /* WKOrientationAccessAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKOrientationAccessAlert.mm; sourceTree = "<group>"; }; 3131 3135 466BC0381FA266C9002FA9C1 /* WebSWContextManagerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSWContextManagerConnection.cpp; sourceTree = "<group>"; }; 3132 3136 466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSWContextManagerConnection.h; sourceTree = "<group>"; }; … … 5438 5442 E1AEA22D14687BDB00804569 /* WKFullKeyboardAccessWatcher.h */, 5439 5443 E1AEA22E14687BDB00804569 /* WKFullKeyboardAccessWatcher.mm */, 5444 4657D88722664A19005DE823 /* WKOrientationAccessAlert.h */, 5445 4657D88822664A1A005DE823 /* WKOrientationAccessAlert.mm */, 5440 5446 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */, 5441 5447 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */, … … 9974 9980 BC857FE612B843D800EDEB2E /* WKOpenPanelParametersRef.h in Headers */, 9975 9981 BC1DFE8F12B31CA8005DF730 /* WKOpenPanelResultListener.h in Headers */, 9982 4657D88922664A2D005DE823 /* WKOrientationAccessAlert.h in Headers */, 9976 9983 BCD597D7112B56DC00EC8C23 /* WKPage.h in Headers */, 9977 9984 7C89D29C1A67837B003A5FDE /* WKPageConfigurationRef.h in Headers */, … … 11264 11271 2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */, 11265 11272 637281A321ADC744009E0DE6 /* WKDownloadProgress.mm in Sources */, 11273 4657D88A22664A2F005DE823 /* WKOrientationAccessAlert.mm in Sources */, 11266 11274 5CA26D83217AD1B800F97A35 /* WKSafeBrowsingWarning.mm in Sources */, 11267 11275 1DB01944211CF005009FB3E8 /* WKShareSheet.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.