Changeset 167611 in webkit
- Timestamp:
- Apr 21, 2014 12:51:01 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r167610 r167611 1 2014-04-21 Anders Carlsson <andersca@apple.com> 2 3 Need default WKNavigationDelegate behavior 4 https://bugs.webkit.org/show_bug.cgi?id=131944 5 <rdar://problem/15949822> 6 7 Reviewed by Dan Bernstein. 8 9 Port the WebKit1 default delegate behavior over. 10 11 * UIProcess/Cocoa/NavigationState.mm: 12 (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): 13 (WebKit::NavigationState::PolicyClient::decidePolicyForResponse): 14 1 15 2014-04-21 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
r167572 r167611 211 211 { 212 212 if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler) { 213 // FIXME: <rdar://problem/15949822> Figure out what the "default delegate behavior" should be here. 214 listener->use(); 213 if (!destinationFrame) { 214 listener->use(); 215 return; 216 } 217 218 NSURLRequest *nsURLRequest = request.nsURLRequest(WebCore::DoNotUpdateHTTPBody); 219 if ([NSURLConnection canHandleRequest:nsURLRequest]) { 220 listener->use(); 221 return; 222 } 223 224 #if PLATFORM(MAC) 225 // A file URL shouldn't fall through to here, but if it did, 226 // it would be a security risk to open it. 227 if (![nsURLRequest.URL isFileURL]) 228 [[NSWorkspace sharedWorkspace] openURL:nsURLRequest.URL]; 229 #endif 230 listener->ignore(); 215 231 return; 216 232 } … … 267 283 { 268 284 if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationResponseDecisionHandler) { 269 // FIXME: <rdar://problem/15949822> Figure out what the "default delegate behavior" should be here. 270 listener->use(); 285 NSURL *url = resourceResponse.nsURLResponse().URL; 286 if ([url isFileURL]) { 287 BOOL isDirectory = NO; 288 BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:url.path isDirectory:&isDirectory]; 289 290 if (exists && !isDirectory && canShowMIMEType) 291 listener->use(); 292 else 293 listener->ignore(); 294 return; 295 } 296 297 if (canShowMIMEType) 298 listener->use(); 299 else 300 listener->ignore(); 271 301 return; 272 302 } … … 276 306 return; 277 307 278 // FIXME: Set up the navigation response object.279 308 auto navigationResponse = adoptNS([[WKNavigationResponse alloc] init]); 280 309
Note: See TracChangeset
for help on using the changeset viewer.