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

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

Issue 2631733002: Avoid sending IDC_BACK/FORWARD when back/forward is not possible (Closed)
Patch Set: Rebased Created 3 years, 11 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 | ios/chrome/browser/ui/key_commands_provider.h » ('j') | 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 3509d68559ea10667cee4be52299d5c63aa0d3fc..c3fda741f8dd394d6275c8392c8b7f1173f8d2f6 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3548,6 +3548,14 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
return [_model count];
}
+- (BOOL)canGoBack {
+ return [_model currentTab].canGoBack;
+}
+
+- (BOOL)canGoForward {
+ return [_model currentTab].canGoForward;
+}
+
- (void)focusTabAtIndex:(NSUInteger)index {
if ([_model count] > index) {
[_model setCurrentTab:[_model tabAtIndex:index]];
@@ -3914,9 +3922,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
switch (command) {
case IDC_BACK:
- if ([_model currentTab].canGoBack) {
- [[_model currentTab] goBack];
- }
+ [[_model currentTab] goBack];
break;
case IDC_BOOKMARK_PAGE:
[self initializeBookmarkInteractionController];
@@ -3957,9 +3963,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
[self searchFindInPage];
break;
case IDC_FORWARD:
- if ([_model currentTab].canGoForward) {
- [[_model currentTab] goForward];
- }
+ [[_model currentTab] goForward];
break;
case IDC_FULLSCREEN:
NOTIMPLEMENTED();
« no previous file with comments | « no previous file | ios/chrome/browser/ui/key_commands_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698