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

Unified Diff: ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm

Issue 2829003002: Add CommandDispatcher to BrowserViewController. (Closed)
Patch Set: rohit comments 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 | « ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm ('k') | 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/ntp/ntp_home_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm b/ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm
index dd8932af9a02311100970c7b905e826728daef87..b2ccedba8577824cf1619c6696f9d67bf1c57e55 100644
--- a/ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.mm
@@ -8,6 +8,7 @@
#import "ios/chrome/browser/ui/ntp/google_landing_mediator.h"
#import "ios/clean/chrome/browser/ui/ntp/ntp_home_mediator.h"
#import "ios/shared/chrome/browser/ui/browser_list/browser.h"
+#import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h"
#import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -29,14 +30,20 @@
// PLACEHOLDER: self.mediator and self.oldMediator should be merged together.
self.mediator = [[NTPHomeMediator alloc] init];
self.mediator.dispatcher = static_cast<id>(self.browser->dispatcher());
+
+ // PLACEHOLDER: These will go elsewhere.
+ [self.browser->dispatcher() startDispatchingToTarget:self.mediator
+ forProtocol:@protocol(UrlLoader)];
+ [self.browser->dispatcher()
+ startDispatchingToTarget:self.mediator
+ forProtocol:@protocol(OmniboxFocuser)];
self.viewController = [[GoogleLandingController alloc] init];
+ self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher());
self.googleLandingMediator = [[GoogleLandingMediator alloc]
- initWithConsumer:self.viewController
- browserState:self.browser->browser_state()
- loader:self.mediator
- focuser:self.mediator
- webToolbarDelegate:nil
- webStateList:&self.browser->web_state_list()];
+ initWithConsumer:self.viewController
+ browserState:self.browser->browser_state()
+ dispatcher:static_cast<id>(self.browser->dispatcher())
+ webStateList:&self.browser->web_state_list()];
self.viewController.dataSource = self.googleLandingMediator;
[super start];
}
@@ -44,6 +51,10 @@
- (void)stop {
[super stop];
[self.googleLandingMediator shutdown];
+
+ [self.browser->dispatcher() stopDispatchingForProtocol:@protocol(UrlLoader)];
+ [self.browser->dispatcher()
+ stopDispatchingForProtocol:@protocol(OmniboxFocuser)];
}
@end
« no previous file with comments | « ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698