| Index: ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
|
| diff --git a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
|
| index 09d356f68e2efbcae4b7529d09ad8d981eb5c2f1..f736febf936796e11525de871a2b6194f8631782 100644
|
| --- a/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
|
| +++ b/ios/clean/chrome/browser/ui/web_contents/web_coordinator.mm
|
| @@ -9,6 +9,7 @@
|
| #import "ios/clean/chrome/browser/ui/web_contents/web_coordinator.h"
|
|
|
| #import "ios/clean/chrome/browser/browser_coordinator+internal.h"
|
| +#import "ios/clean/chrome/browser/ui/web_contents/web_contents_mediator.h"
|
| #import "ios/clean/chrome/browser/ui/web_contents/web_contents_view_controller.h"
|
| #import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h"
|
| #include "ios/web/public/web_state/web_state.h"
|
| @@ -18,19 +19,30 @@
|
| #endif
|
|
|
| @interface WebCoordinator ()
|
| -
|
| @property(nonatomic, strong) WebContentsViewController* viewController;
|
| -
|
| +@property(nonatomic, strong) WebContentsMediator* mediator;
|
| @end
|
|
|
| @implementation WebCoordinator
|
| @synthesize webState = _webState;
|
| @synthesize viewController = _viewController;
|
| +@synthesize mediator = _mediator;
|
| +
|
| +- (instancetype)init {
|
| + if ((self = [super init])) {
|
| + _mediator = [[WebContentsMediator alloc] init];
|
| + }
|
| + return self;
|
| +}
|
| +
|
| +- (void)setWebState:(web::WebState*)webState {
|
| + _webState = webState;
|
| + self.mediator.webState = self.webState;
|
| +}
|
|
|
| - (void)start {
|
| - self.webState->SetWebUsageEnabled(true);
|
| - self.viewController =
|
| - [[WebContentsViewController alloc] initWithWebState:self.webState];
|
| + self.viewController = [[WebContentsViewController alloc] init];
|
| + self.mediator.consumer = self.viewController;
|
|
|
| // Reminder: this is a no-op if |baseViewController| is nil, for example
|
| // when this coordinator's view controller will be contained instead of
|
| @@ -41,7 +53,9 @@
|
| }
|
|
|
| - (void)stop {
|
| - self.webState->SetWebUsageEnabled(false);
|
| + // PLACEHOLDER: This is how the webUsageEnabled is set to false. Find a
|
| + // better way in the future.
|
| + self.mediator.webState = nullptr;
|
| }
|
|
|
| @end
|
|
|