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

Unified Diff: ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm

Issue 2809563002: [ios clean] Fixes Toolbar navigation crash. (Closed)
Patch Set: Created 3 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm b/ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm
index 75be7f58c3af16079f23f586ad29198d7af03742..c6743ce14532c6d0500ccf91b01f02421d291d30 100644
--- a/ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.mm
@@ -113,11 +113,15 @@
#pragma mark - NavigationCommands
- (void)goBack {
- self.webState->GetNavigationManager()->GoBack();
+ if (self.webState->GetNavigationManager()->CanGoBack()) {
+ self.webState->GetNavigationManager()->GoBack();
edchin 2017/04/10 05:13:15 I wonder if the GoBack() method should simply no-o
marq (ping after 24h) 2017/04/10 11:14:09 If it's a programming error to call GoBack() when
rohitrao (ping after 24h) 2017/04/10 12:47:03 I would prefer that GoBack() fail loudly if CanGoB
+ }
}
- (void)goForward {
- self.webState->GetNavigationManager()->GoForward();
+ if (self.webState->GetNavigationManager()->CanGoForward()) {
+ self.webState->GetNavigationManager()->GoForward();
+ }
}
- (void)stopLoadingPage {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698