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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #pragma mark - BrowserCoordinator | 27 #pragma mark - BrowserCoordinator |
28 | 28 |
29 - (void)start { | 29 - (void)start { |
30 self.menuViewController = [[MenuViewController alloc] init]; | 30 self.menuViewController = [[MenuViewController alloc] init]; |
31 self.menuViewController.modalPresentationStyle = UIModalPresentationCustom; | 31 self.menuViewController.modalPresentationStyle = UIModalPresentationCustom; |
32 self.menuViewController.transitioningDelegate = self; | 32 self.menuViewController.transitioningDelegate = self; |
33 self.menuViewController.dispatcher = | 33 self.menuViewController.dispatcher = |
34 static_cast<id>(self.browser->dispatcher()); | 34 static_cast<id>(self.browser->dispatcher()); |
35 _mediator = [[ToolsMediator alloc] initWithConsumer:self.menuViewController]; | 35 _mediator = [[ToolsMediator alloc] initWithConsumer:self.menuViewController]; |
| 36 self.menuViewController.dispatcher = |
| 37 static_cast<id>(self.browser->dispatcher()); |
36 | 38 |
37 [self.context.baseViewController presentViewController:self.menuViewController | 39 [self.context.baseViewController presentViewController:self.menuViewController |
38 animated:self.context.animated | 40 animated:self.context.animated |
39 completion:nil]; | 41 completion:nil]; |
40 [super start]; | 42 [super start]; |
41 } | 43 } |
42 | 44 |
43 - (void)stop { | 45 - (void)stop { |
44 [super stop]; | 46 [super stop]; |
45 [self.menuViewController.presentingViewController | 47 [self.menuViewController.presentingViewController |
(...skipping 27 matching lines...) Expand all Loading... |
73 sourceViewController:(UIViewController*)source { | 75 sourceViewController:(UIViewController*)source { |
74 MenuPresentationController* menuPresentation = | 76 MenuPresentationController* menuPresentation = |
75 [[MenuPresentationController alloc] | 77 [[MenuPresentationController alloc] |
76 initWithPresentedViewController:presented | 78 initWithPresentedViewController:presented |
77 presentingViewController:presenting]; | 79 presentingViewController:presenting]; |
78 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher()); | 80 menuPresentation.dispatcher = static_cast<id>(self.browser->dispatcher()); |
79 return menuPresentation; | 81 return menuPresentation; |
80 } | 82 } |
81 | 83 |
82 @end | 84 @end |
OLD | NEW |