Add reload and reloadFromOrigin as API
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Mar 2014 21:21:14 +0000 (21:21 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Mar 2014 21:21:14 +0000 (21:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130858

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView reload]):
(-[WKWebView reloadFromOrigin]):
(-[WKWebView validateUserInterfaceItem:]):
(-[WKWebView reload:]):
(-[WKWebView reloadFromOrigin:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

index e1f945291bcef0813917de8289c865fa5411a329..3fbe78e1c05a00c9f4c7e589632d15f025c54374 100644 (file)
@@ -1,3 +1,18 @@
+2014-03-27  Anders Carlsson  <andersca@apple.com>
+
+        Add reload and reloadFromOrigin as API
+        https://bugs.webkit.org/show_bug.cgi?id=130858
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/API/Cocoa/WKWebView.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView reload]):
+        (-[WKWebView reloadFromOrigin]):
+        (-[WKWebView validateUserInterfaceItem:]):
+        (-[WKWebView reload:]):
+        (-[WKWebView reloadFromOrigin:]):
+
 2014-03-27  Anders Carlsson  <andersca@apple.com>
 
         Rename WKFrameHandle to _WKFrameHandle
 2014-03-27  Anders Carlsson  <andersca@apple.com>
 
         Rename WKFrameHandle to _WKFrameHandle
index 5a440c7e6e7a5a9143f67008436dcf7e91662e4d..dec47b9ae232da4a2846655367f39aa475038d70 100644 (file)
@@ -118,6 +118,9 @@ WK_API_CLASS
 - (WKNavigation *)goBack;
 - (WKNavigation *)goForward;
 
 - (WKNavigation *)goBack;
 - (WKNavigation *)goForward;
 
+- (WKNavigation *)reload;
+- (WKNavigation *)reloadFromOrigin;
+
 - (void)stopLoading;
 
 // FIXME: Move this to WKIBActions.
 - (void)stopLoading;
 
 // FIXME: Move this to WKIBActions.
@@ -143,6 +146,9 @@ WK_API_CLASS
 - (IBAction)goBack:(id)sender;
 - (IBAction)goForward:(id)sender;
 
 - (IBAction)goBack:(id)sender;
 - (IBAction)goForward:(id)sender;
 
+- (IBAction)reload:(id)sender;
+- (IBAction)reloadFromOrigin:(id)sender;
+
 @end
 
 #endif
 @end
 
 #endif
index ad4e2e27d3c508fea40712c805690fc70cf394c1..0af9b2ca0ea5ba4b2706daad36ffed1cb3b1f6d5 100644 (file)
     return nil;
 }
 
     return nil;
 }
 
+- (WKNavigation *)reload
+{
+    _page->reload(false);
+
+    // FIXME: Return a navigation object.
+    return nil;
+}
+
+- (WKNavigation *)reloadFromOrigin
+{
+    _page->reload(true);
+
+    // FIXME: Return a navigation object.
+    return nil;
+}
+
 - (void)stopLoading
 {
     _page->stopLoading();
 - (void)stopLoading
 {
     _page->stopLoading();
@@ -1213,6 +1229,11 @@ static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEve
         return YES;
     }
 
         return YES;
     }
 
+    if (action == @selector(reload:) || action == @selector(reloadFromOrigin:)) {
+        // FIXME: Return no if we're loading.
+        return YES;
+    }
+
     return NO;
 }
 
     return NO;
 }
 
@@ -1226,6 +1247,16 @@ static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEve
     [self goForward];
 }
 
     [self goForward];
 }
 
+- (IBAction)reload:(id)sender
+{
+    [self reload];
+}
+
+- (IBAction)reloadFromOrigin:(id)sender
+{
+    [self reloadFromOrigin];
+}
+
 @end
 
 #endif
 @end
 
 #endif