Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2509493003: Revert of [ios] Removed back-forward navigation API from CRWWebController. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index bbf10276e74fd59475dff1462110eabae63182d7..7e3f9d70073e15f3f05a195993d34c54202339ca 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1379,6 +1379,14 @@
return defaultImage;
}
+- (BOOL)canGoBack {
+ return _webStateImpl->GetNavigationManagerImpl().CanGoBack();
+}
+
+- (BOOL)canGoForward {
+ return _webStateImpl->GetNavigationManagerImpl().CanGoForward();
+}
+
- (CGPoint)scrollPosition {
CGPoint position = CGPointMake(0.0, 0.0);
if (!self.webScrollView)
@@ -2271,6 +2279,14 @@
case web::PAGE_LOADED:
break;
}
+}
+
+- (void)goBack {
+ [self goDelta:-1];
+}
+
+- (void)goForward {
+ [self goDelta:1];
}
- (void)goDelta:(int)delta {
@@ -3016,13 +3032,13 @@
- (BOOL)handleWindowHistoryBackMessage:(base::DictionaryValue*)message
context:(NSDictionary*)context {
- [self goDelta:-1];
+ [self goBack];
return YES;
}
- (BOOL)handleWindowHistoryForwardMessage:(base::DictionaryValue*)message
context:(NSDictionary*)context {
- [self goDelta:1];
+ [self goForward];
return YES;
}
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698