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

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

Issue 2965963002: [ios] Remove IDC_STOP and IDC_RELOAD
Patch Set: Rebased. Created 3 years, 5 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/commands/browser_commands.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 fffe177fc94b7a0546405d1171ac82dd2a80b5a7..51b66e9dbe616be6f0364e6d862939be42747172 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3532,6 +3532,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
bridge:bridge
sourceFrame:[sourceView convertRect:[sourceView bounds] toView:view]
parentView:view];
+ _pageInfoController.dispatcher = self.browserCommandDispatcher;
bridge->set_controller(_pageInfoController);
}
@@ -3969,9 +3970,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
- (IBAction)locationBarBeganEdit:(id)sender {
// On handsets, if a page is currently loading it should be stopped.
if (!IsIPadIdiom() && _toolbarModelIOS->IsLoading()) {
- GenericChromeCommand* command =
- [[GenericChromeCommand alloc] initWithTag:IDC_STOP];
- [self chromeExecuteCommand:command];
+ [self.browserCommandDispatcher stopLoading];
_locationBarEditCancelledLoad = YES;
}
}
@@ -4030,6 +4029,20 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
[[_model currentTab] goForward];
}
+- (void)stopLoading {
+ [_model currentTab].webState->Stop();
+}
+
+- (void)reload {
+ web::WebState* webState = [_model currentTab].webState;
+ if (webState) {
+ // |check_for_repost| is true because the reload is explicitly initiated
+ // by the user.
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ true /* check_for_repost */);
+ }
+}
+
#pragma mark - Command Handling
- (IBAction)chromeExecuteCommand:(id)sender {
@@ -4104,12 +4117,8 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}
break;
case IDC_RELOAD: {
- web::WebState* webState = [_model currentTab].webState;
- if (webState)
- // |check_for_repost| is true because the reload is explicitly initiated
- // by the user.
- webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
- true /* check_for_repost */);
+ // Route to dispatcher until downstream code is migrated.
+ [self.browserCommandDispatcher reload];
break;
}
case IDC_SHARE_PAGE:
@@ -4153,9 +4162,6 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}
break;
}
- case IDC_STOP:
- [_model currentTab].webState->Stop();
- break;
#if !defined(NDEBUG)
case IDC_VIEW_SOURCE:
[self viewSource];
« no previous file with comments | « no previous file | ios/chrome/browser/ui/commands/browser_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698