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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2605713002: [ios] Made IDC_BACK and IDC_FORWARD safe. (Closed)
Patch Set: Added TODO Created 4 years 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/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index a612ccb5560b4fadd2c81d1c3d7f9c27a3c55b9d..9263577d11dc9f38eb7e10b983605e59f3252a5b 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3872,7 +3872,10 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
switch (command) {
case IDC_BACK:
- [[_model currentTab] goBack];
+ // TODO(crbug.com.677160): Remove |canGoBack| check.
+ if ([_model currentTab].canGoBack) {
+ [[_model currentTab] goBack];
+ }
break;
case IDC_BOOKMARK_PAGE:
[self initializeBookmarkInteractionController];
@@ -3913,7 +3916,10 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
[self searchFindInPage];
break;
case IDC_FORWARD:
- [[_model currentTab] goForward];
+ // TODO(crbug.com.677160): Remove |canGoForward| check.
+ if ([_model currentTab].canGoForward) {
+ [[_model currentTab] goForward];
+ }
break;
case IDC_FULLSCREEN:
NOTIMPLEMENTED();
« 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