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 // ====== New Architecture ===== | 5 // ====== New Architecture ===== |
6 // = This code is only used in the new iOS Chrome architecture. = | 6 // = This code is only used in the new iOS Chrome architecture. = |
7 // ============================================================================ | 7 // ============================================================================ |
8 | 8 |
9 #import "ios/clean/chrome/browser/ui/tools/tools_coordinator.h" | 9 #import "ios/clean/chrome/browser/ui/tools/tools_coordinator.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #pragma mark - BrowserCoordinator | 28 #pragma mark - BrowserCoordinator |
29 | 29 |
30 - (void)start { | 30 - (void)start { |
31 self.menuViewController = [[MenuViewController alloc] init]; | 31 self.menuViewController = [[MenuViewController alloc] init]; |
32 self.menuViewController.modalPresentationStyle = UIModalPresentationCustom; | 32 self.menuViewController.modalPresentationStyle = UIModalPresentationCustom; |
33 self.menuViewController.transitioningDelegate = self; | 33 self.menuViewController.transitioningDelegate = self; |
34 | 34 |
35 [self.context.baseViewController presentViewController:self.menuViewController | 35 [self.context.baseViewController presentViewController:self.menuViewController |
36 animated:self.context.animated | 36 animated:self.context.animated |
37 completion:nil]; | 37 completion:nil]; |
| 38 [super start]; |
38 } | 39 } |
39 | 40 |
40 - (void)stop { | 41 - (void)stop { |
| 42 [super stop]; |
41 [self.menuViewController.presentingViewController | 43 [self.menuViewController.presentingViewController |
42 dismissViewControllerAnimated:self.context.animated | 44 dismissViewControllerAnimated:self.context.animated |
43 completion:nil]; | 45 completion:nil]; |
44 } | 46 } |
45 | 47 |
46 #pragma mark - UIViewControllerTransitioningDelegate | 48 #pragma mark - UIViewControllerTransitioningDelegate |
47 | 49 |
48 - (id<UIViewControllerAnimatedTransitioning>) | 50 - (id<UIViewControllerAnimatedTransitioning>) |
49 animationControllerForPresentedController:(UIViewController*)presented | 51 animationControllerForPresentedController:(UIViewController*)presented |
50 presentingController:(UIViewController*)presenting | 52 presentingController:(UIViewController*)presenting |
(...skipping 18 matching lines...) Expand all Loading... |
69 sourceViewController:(UIViewController*)source { | 71 sourceViewController:(UIViewController*)source { |
70 MenuPresentationController* menuPresentation = | 72 MenuPresentationController* menuPresentation = |
71 [[MenuPresentationController alloc] | 73 [[MenuPresentationController alloc] |
72 initWithPresentedViewController:presented | 74 initWithPresentedViewController:presented |
73 presentingViewController:presenting]; | 75 presentingViewController:presenting]; |
74 menuPresentation.toolbarCommandHandler = self.toolbarCommandHandler; | 76 menuPresentation.toolbarCommandHandler = self.toolbarCommandHandler; |
75 return menuPresentation; | 77 return menuPresentation; |
76 } | 78 } |
77 | 79 |
78 @end | 80 @end |
OLD | NEW |