| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tools/tools_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/tools/tools_coordinator.h" |
| 6 | 6 |
| 7 #import "ios/clean/chrome/browser/ui/animators/zoom_transition_animator.h" | 7 #import "ios/clean/chrome/browser/ui/animators/zoom_transition_animator.h" |
| 8 #import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h" | 8 #import "ios/clean/chrome/browser/ui/presenters/menu_presentation_controller.h" |
| 9 #import "ios/clean/chrome/browser/ui/tools/menu_view_controller.h" | 9 #import "ios/clean/chrome/browser/ui/tools/menu_view_controller.h" |
| 10 #import "ios/clean/chrome/browser/ui/tools/tools_mediator.h" | 10 #import "ios/clean/chrome/browser/ui/tools/tools_mediator.h" |
| 11 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 11 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
| 12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." | 14 #error "This file requires ARC support." |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 @interface ToolsCoordinator ()<UIViewControllerTransitioningDelegate> | 17 @interface ToolsCoordinator ()<UIViewControllerTransitioningDelegate> |
| 18 @property(nonatomic, strong) MenuViewController* viewController; | 18 @property(nonatomic, strong) MenuViewController* viewController; |
| 19 @property(nonatomic, strong) ToolsMediator* mediator; | 19 @property(nonatomic, strong) ToolsMediator* mediator; |
| 20 @end | 20 @end |
| 21 | 21 |
| 22 @implementation ToolsCoordinator | 22 @implementation ToolsCoordinator |
| 23 @synthesize viewController = _viewController; | 23 @synthesize viewController = _viewController; |
| 24 @synthesize mediator = _mediator; | 24 @synthesize mediator = _mediator; |
| 25 @synthesize toolsMenuConfiguration = _toolsMenuConfiguration; |
| 25 | 26 |
| 26 #pragma mark - BrowserCoordinator | 27 #pragma mark - BrowserCoordinator |
| 27 | 28 |
| 28 - (void)start { | 29 - (void)start { |
| 29 self.viewController = [[MenuViewController alloc] init]; | 30 self.viewController = [[MenuViewController alloc] init]; |
| 30 self.viewController.modalPresentationStyle = UIModalPresentationCustom; | 31 self.viewController.modalPresentationStyle = UIModalPresentationCustom; |
| 31 self.viewController.transitioningDelegate = self; | 32 self.viewController.transitioningDelegate = self; |
| 32 self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); | 33 self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); |
| 33 self.mediator = [[ToolsMediator alloc] initWithConsumer:self.viewController]; | 34 self.mediator = [[ToolsMediator alloc] initWithConsumer:self.viewController]; |
| 35 self.mediator.toolsMenuConfiguration = self.toolsMenuConfiguration; |
| 34 | 36 |
| 35 [super start]; | 37 [super start]; |
| 36 } | 38 } |
| 37 | 39 |
| 38 #pragma mark - UIViewControllerTransitioningDelegate | 40 #pragma mark - UIViewControllerTransitioningDelegate |
| 39 | 41 |
| 40 - (id<UIViewControllerAnimatedTransitioning>) | 42 - (id<UIViewControllerAnimatedTransitioning>) |
| 41 animationControllerForPresentedController:(UIViewController*)presented | 43 animationControllerForPresentedController:(UIViewController*)presented |
| 42 presentingController:(UIViewController*)presenting | 44 presentingController:(UIViewController*)presenting |
| 43 sourceController:(UIViewController*)source { | 45 sourceController:(UIViewController*)source { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 sourceViewController:(UIViewController*)source { | 63 sourceViewController:(UIViewController*)source { |
| 62 MenuPresentationController* menuPresentation = | 64 MenuPresentationController* menuPresentation = |
| 63 [[MenuPresentationController alloc] | 65 [[MenuPresentationController alloc] |
| 64 initWithPresentedViewController:presented | 66 initWithPresentedViewController:presented |
| 65 presentingViewController:presenting]; | 67 presentingViewController:presenting]; |
| 66 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher()); | 68 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher()); |
| 67 return menuPresentation; | 69 return menuPresentation; |
| 68 } | 70 } |
| 69 | 71 |
| 70 @end | 72 @end |
| OLD | NEW |