| 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 20 matching lines...) Expand all Loading... |
| 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.baseViewController presentViewController:self.menuViewController | 35 [self.baseViewController presentViewController:self.menuViewController |
| 36 animated:self.context.animated | 36 animated:self.context.animated |
| 37 completion:nil]; | 37 completion:nil]; |
| 38 } | 38 } |
| 39 | 39 |
| 40 - (void)stop { | 40 - (void)stop { |
| 41 [self.menuViewController dismissViewControllerAnimated:self.context.animated | 41 [self.menuViewController.presentingViewController |
| 42 completion:nil]; | 42 dismissViewControllerAnimated:self.context.animated |
| 43 completion:nil]; |
| 43 } | 44 } |
| 44 | 45 |
| 45 #pragma mark - UIViewControllerTransitioningDelegate | 46 #pragma mark - UIViewControllerTransitioningDelegate |
| 46 | 47 |
| 47 - (id<UIViewControllerAnimatedTransitioning>) | 48 - (id<UIViewControllerAnimatedTransitioning>) |
| 48 animationControllerForPresentedController:(UIViewController*)presented | 49 animationControllerForPresentedController:(UIViewController*)presented |
| 49 presentingController:(UIViewController*)presenting | 50 presentingController:(UIViewController*)presenting |
| 50 sourceController:(UIViewController*)source { | 51 sourceController:(UIViewController*)source { |
| 51 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init]; | 52 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init]; |
| 52 animator.presenting = YES; | 53 animator.presenting = YES; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 sourceViewController:(UIViewController*)source { | 69 sourceViewController:(UIViewController*)source { |
| 69 MenuPresentationController* menuPresentation = | 70 MenuPresentationController* menuPresentation = |
| 70 [[MenuPresentationController alloc] | 71 [[MenuPresentationController alloc] |
| 71 initWithPresentedViewController:presented | 72 initWithPresentedViewController:presented |
| 72 presentingViewController:presenting]; | 73 presentingViewController:presenting]; |
| 73 menuPresentation.toolbarCommandHandler = self.toolbarCommandHandler; | 74 menuPresentation.toolbarCommandHandler = self.toolbarCommandHandler; |
| 74 return menuPresentation; | 75 return menuPresentation; |
| 75 } | 76 } |
| 76 | 77 |
| 77 @end | 78 @end |
| OLD | NEW |