OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/ntp/ntp_home_coordinator.h" |
6 | 6 |
7 #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h" | 7 #import "ios/chrome/browser/ui/ntp/google_landing_mediator.h" |
8 #import "ios/chrome/browser/ui/ntp/google_landing_view_controller.h" | 8 #import "ios/chrome/browser/ui/ntp/google_landing_view_controller.h" |
9 #import "ios/clean/chrome/browser/ui/ntp/ntp_home_mediator.h" | 9 #import "ios/clean/chrome/browser/ui/ntp/ntp_home_mediator.h" |
10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 @end | 22 @end |
23 | 23 |
24 @implementation NTPHomeCoordinator | 24 @implementation NTPHomeCoordinator |
25 @synthesize mediator = _mediator; | 25 @synthesize mediator = _mediator; |
26 @synthesize googleLandingMediator = _googleLandingMediator; | 26 @synthesize googleLandingMediator = _googleLandingMediator; |
27 @synthesize viewController = _viewController; | 27 @synthesize viewController = _viewController; |
28 | 28 |
29 - (void)start { | 29 - (void)start { |
30 // PLACEHOLDER: self.mediator and self.oldMediator should be merged together. | 30 // PLACEHOLDER: self.mediator and self.oldMediator should be merged together. |
31 self.mediator = [[NTPHomeMediator alloc] init]; | 31 self.mediator = [[NTPHomeMediator alloc] init]; |
32 self.mediator.dispatcher = static_cast<id>(self.browser->dispatcher()); | 32 self.mediator.dispatcher = self.callableDispatcher; |
33 | 33 |
34 // PLACEHOLDER: These will go elsewhere. | 34 // PLACEHOLDER: These will go elsewhere. |
35 [self.browser->dispatcher() startDispatchingToTarget:self.mediator | 35 [self.dispatcher startDispatchingToTarget:self.mediator |
36 forProtocol:@protocol(UrlLoader)]; | 36 forProtocol:@protocol(UrlLoader)]; |
37 [self.browser->dispatcher() | 37 [self.dispatcher startDispatchingToTarget:self.mediator |
38 startDispatchingToTarget:self.mediator | 38 forProtocol:@protocol(OmniboxFocuser)]; |
39 forProtocol:@protocol(OmniboxFocuser)]; | |
40 self.viewController = [[GoogleLandingViewController alloc] init]; | 39 self.viewController = [[GoogleLandingViewController alloc] init]; |
41 self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); | 40 self.viewController.dispatcher = self.callableDispatcher; |
42 self.googleLandingMediator = [[GoogleLandingMediator alloc] | 41 self.googleLandingMediator = [[GoogleLandingMediator alloc] |
43 initWithConsumer:self.viewController | 42 initWithConsumer:self.viewController |
44 browserState:self.browser->browser_state() | 43 browserState:self.browser->browser_state() |
45 dispatcher:static_cast<id>(self.browser->dispatcher()) | 44 dispatcher:self.callableDispatcher |
46 webStateList:&self.browser->web_state_list()]; | 45 webStateList:&self.browser->web_state_list()]; |
47 self.viewController.dataSource = self.googleLandingMediator; | 46 self.viewController.dataSource = self.googleLandingMediator; |
48 [super start]; | 47 [super start]; |
49 } | 48 } |
50 | 49 |
51 - (void)stop { | 50 - (void)stop { |
52 [super stop]; | 51 [super stop]; |
53 [self.googleLandingMediator shutdown]; | 52 [self.googleLandingMediator shutdown]; |
54 | 53 |
55 [self.browser->dispatcher() stopDispatchingForProtocol:@protocol(UrlLoader)]; | 54 [self.dispatcher stopDispatchingForProtocol:@protocol(UrlLoader)]; |
56 [self.browser->dispatcher() | 55 [self.dispatcher stopDispatchingForProtocol:@protocol(OmniboxFocuser)]; |
57 stopDispatchingForProtocol:@protocol(OmniboxFocuser)]; | |
58 } | 56 } |
59 | 57 |
60 @end | 58 @end |
OLD | NEW |