Changeset 166241 in webkit
- Timestamp:
- Mar 25, 2014 12:17:54 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r166239 r166241 1 2014-03-25 Anders Carlsson <andersca@apple.com> 2 3 Add goBack: and goForward: IBActions and move stopLoading: to a new WKIBActions category on WKWebView 4 https://bugs.webkit.org/show_bug.cgi?id=130732 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/Cocoa/WKWebView.h: 9 * UIProcess/API/Cocoa/WKWebView.mm: 10 (-[WKWebView goBack]): 11 (-[WKWebView goForward]): 12 (-[WKWebView validateUserInterfaceItem:]): 13 (-[WKWebView goBack:]): 14 (-[WKWebView goForward:]): 15 (-[WKWebView stopLoading:]): 16 1 17 2014-03-25 Martin Robinson <mrobinson@igalia.com> 2 18 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h
r165678 r166241 90 90 - (WKNavigation *)goToBackForwardListItem:(WKBackForwardListItem *)item; 91 91 92 - (IBAction)stopLoading:(id)sender;93 94 92 @property (nonatomic, readonly) NSString *title; 95 93 … … 118 116 @property (readonly) BOOL canGoForward; 119 117 120 - ( void)goBack;121 - ( void)goForward;118 - (WKNavigation *)goBack; 119 - (WKNavigation *)goForward; 122 120 123 121 @property (nonatomic) BOOL allowsBackForwardNavigationGestures; … … 134 132 @end 135 133 134 @interface WKWebView (WKIBActions) <NSUserInterfaceValidations> 135 136 - (IBAction)goBack:(id)sender; 137 - (IBAction)goForward:(id)sender; 138 139 - (IBAction)stopLoading:(id)sender; 140 141 @end 142 136 143 #endif -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r166188 r166241 257 257 } 258 258 259 - (IBAction)stopLoading:(id)sender260 {261 _page->stopLoading();262 }263 264 259 - (NSString *)title 265 260 { … … 299 294 } 300 295 301 // FIXME: This should return a WKNavigation object. 302 - (void)goBack 296 - (WKNavigation *)goBack 303 297 { 304 298 _page->goBack(); 305 } 306 307 // FIXME: This should return a WKNavigation object. 308 - (void)goForward 299 300 // FIXME: Return a navigation object. 301 return nil; 302 } 303 304 - (WKNavigation *)goForward 309 305 { 310 306 _page->goForward(); 307 308 // FIXME: Return a navigation object. 309 return nil; 311 310 } 312 311 … … 1178 1177 @end 1179 1178 1179 @implementation WKWebView (WKIBActions) 1180 1181 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item 1182 { 1183 SEL action = item.action; 1184 1185 if (action == @selector(goBack:)) 1186 return !!_page->backForwardList().backItem(); 1187 1188 if (action == @selector(goForward:)) 1189 return !!_page->backForwardList().forwardItem(); 1190 1191 if (action == @selector(stopLoading:)) { 1192 // FIXME: Return no if we're stopped. 1193 return YES; 1194 } 1195 1196 return NO; 1197 } 1198 1199 - (IBAction)goBack:(id)sender 1200 { 1201 [self goBack]; 1202 } 1203 1204 - (IBAction)goForward:(id)sender 1205 { 1206 [self goForward]; 1207 } 1208 1209 - (IBAction)stopLoading:(id)sender 1210 { 1211 _page->stopLoading(); 1212 } 1213 1214 @end 1215 1180 1216 #endif // WK_API_ENABLED -
trunk/Tools/ChangeLog
r166239 r166241 1 2014-03-25 Anders Carlsson <andersca@apple.com> 2 3 Add goBack: and goForward: IBActions and move stopLoading: to a new WKIBActions category on WKWebView 4 https://bugs.webkit.org/show_bug.cgi?id=130732 5 6 Reviewed by Tim Horton. 7 8 * MiniBrowser/mac/WK2BrowserWindowController.m: 9 (-[WK2BrowserWindowController validateUserInterfaceItem:]): 10 1 11 2014-03-25 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r165930 r166241 195 195 - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item 196 196 { 197 SEL action = [item action]; 198 199 if (action == @selector(goBack:)) 200 return _webView && [_webView canGoBack]; 201 202 if (action == @selector(goForward:)) 203 return _webView && [_webView canGoForward]; 204 197 SEL action = item.action; 198 199 if (action == @selector(goBack:) || action == @selector(goForward:)) 200 return [_webView validateUserInterfaceItem:item]; 201 205 202 return YES; 206 203 }
Note: See TracChangeset
for help on using the changeset viewer.