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

Side by Side Diff: ios/clean/chrome/browser/ui/tools/tools_coordinator.mm

Issue 2814963002: [ios clean] Use ToolsMenuConfiguration for Menu context. (Closed)
Patch Set: Update Unittest 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 unified diff | Download patch
OLDNEW
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 =
35 [[ToolsMediator alloc] initWithConsumer:self.viewController
36 andConfiguration:self.toolsMenuConfiguration];
34 [super start]; 37 [super start];
35 } 38 }
36 39
37 #pragma mark - UIViewControllerTransitioningDelegate 40 #pragma mark - UIViewControllerTransitioningDelegate
38 41
39 - (id<UIViewControllerAnimatedTransitioning>) 42 - (id<UIViewControllerAnimatedTransitioning>)
40 animationControllerForPresentedController:(UIViewController*)presented 43 animationControllerForPresentedController:(UIViewController*)presented
41 presentingController:(UIViewController*)presenting 44 presentingController:(UIViewController*)presenting
42 sourceController:(UIViewController*)source { 45 sourceController:(UIViewController*)source {
43 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init]; 46 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init];
(...skipping 16 matching lines...) Expand all
60 sourceViewController:(UIViewController*)source { 63 sourceViewController:(UIViewController*)source {
61 MenuPresentationController* menuPresentation = 64 MenuPresentationController* menuPresentation =
62 [[MenuPresentationController alloc] 65 [[MenuPresentationController alloc]
63 initWithPresentedViewController:presented 66 initWithPresentedViewController:presented
64 presentingViewController:presenting]; 67 presentingViewController:presenting];
65 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher()); 68 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher());
66 return menuPresentation; 69 return menuPresentation;
67 } 70 }
68 71
69 @end 72 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/tools/tools_coordinator.h ('k') | ios/clean/chrome/browser/ui/tools/tools_mediator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698