Changeset 207713 in webkit
- Timestamp:
- Oct 22, 2016, 9:30:17 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
MiniBrowser/mac/WK1BrowserWindowController.m (modified) (4 diffs)
-
MiniBrowser/mac/WK2BrowserWindowController.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r207708 r207713 1 2016-10-22 Dan Bernstein <mitz@apple.com> 2 3 Improve MiniBrowser window titles for URLs without paths and with no title 4 <https://webkit.org/b/163843> 5 6 Reviewed by Darin Adler. 7 8 * MiniBrowser/mac/WK1BrowserWindowController.m: 9 (-[WK1BrowserWindowController fetch:]): While we’re here, deploy 10 +[NSURL _webkit_URLWithUserTypedString:] here to match the WK2BrowserWindowController 11 version of this method. 12 (-[WK1BrowserWindowController updateTitle:]): If the URL doesn’t have a lastPathComponent, 13 use the entire URL. 14 (-[WK1BrowserWindowController webView:didCommitLoadForFrame:]): Also while we’re here, 15 deploy +[NSURL _web_userVisibleString] here to match the WK2BrowserWindowController 16 behavior. 17 18 * MiniBrowser/mac/WK2BrowserWindowController.m: 19 (-[WK2BrowserWindowController updateTitle:]): If the URL doesn’t have a lastPathComponent, 20 use the entire URL. 21 1 22 2016-10-21 David Kilzer <ddkilzer@apple.com> 2 23 -
trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m
r207512 r207713 29 29 #import "SettingsController.h" 30 30 #import <WebKit/WebKit.h> 31 #import <WebKit/WebNSURLExtras.h> 31 32 #import <WebKit/WebPreferences.h> 32 33 #import <WebKit/WebPreferencesPrivate.h> … … 82 83 { 83 84 [urlText setStringValue:[self addProtocolIfNecessary:[urlText stringValue]]]; 84 NSURL *url = [NSURL URLWithString:[urlText stringValue]];85 NSURL *url = [NSURL _webkit_URLWithUserTypedString:urlText.stringValue]; 85 86 [[_webView mainFrame] loadRequest:[NSURLRequest requestWithURL:url]]; 86 87 } … … 336 337 if (!title) { 337 338 NSURL *url = _webView.mainFrame.dataSource.request.URL; 338 title = url.lastPathComponent ;339 title = url.lastPathComponent ?: url._web_userVisibleString; 339 340 } 340 341 … … 356 357 357 358 NSURL *committedURL = [[[frame dataSource] request] URL]; 358 [urlText setStringValue:[committedURL absoluteString]];359 urlText.stringValue = committedURL._web_userVisibleString; 359 360 360 361 [self updateTitle:nil]; -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r207512 r207713 404 404 - (void)updateTitle:(NSString *)title 405 405 { 406 if (!title) 407 title = _webView.URL.lastPathComponent; 408 406 if (!title) { 407 NSURL *url = _webView.URL; 408 title = url.lastPathComponent ?: url._web_userVisibleString; 409 } 410 409 411 self.window.title = [NSString stringWithFormat:@"%@%@ [WK2 %d]", _isPrivateBrowsingWindow ? @"🙈 " : @"", title, _webView._webProcessIdentifier]; 410 412 }
Note:
See TracChangeset
for help on using the changeset viewer.