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/tab/tab_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/tab/tab_coordinator.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #pragma mark - BrowserCoordinator | 45 #pragma mark - BrowserCoordinator |
46 | 46 |
47 - (void)start { | 47 - (void)start { |
48 self.viewController = [self newTabContainer]; | 48 self.viewController = [self newTabContainer]; |
49 self.viewController.transitioningDelegate = self; | 49 self.viewController.transitioningDelegate = self; |
50 self.viewController.modalPresentationStyle = UIModalPresentationCustom; | 50 self.viewController.modalPresentationStyle = UIModalPresentationCustom; |
51 _webStateObserver = | 51 _webStateObserver = |
52 base::MakeUnique<web::WebStateObserverBridge>(self.webState, self); | 52 base::MakeUnique<web::WebStateObserverBridge>(self.webState, self); |
53 | 53 |
54 WebCoordinator* webCoordinator = [[WebCoordinator alloc] init]; | 54 WebCoordinator* webCoordinator = [[WebCoordinator alloc] init]; |
55 webCoordinator.webState = self.webState; | |
56 [self addChildCoordinator:webCoordinator]; | 55 [self addChildCoordinator:webCoordinator]; |
57 // Unset the base view controller, so |webCoordinator| doesn't present its | 56 // Unset the base view controller, so |webCoordinator| doesn't present its |
58 // view controller. | 57 // view controller. |
59 webCoordinator.context.baseViewController = nil; | 58 webCoordinator.context.baseViewController = nil; |
60 [webCoordinator start]; | 59 [webCoordinator start]; |
61 | 60 |
62 ToolbarCoordinator* toolbarCoordinator = [[ToolbarCoordinator alloc] init]; | 61 ToolbarCoordinator* toolbarCoordinator = [[ToolbarCoordinator alloc] init]; |
63 toolbarCoordinator.webState = self.webState; | 62 toolbarCoordinator.webState = self.webState; |
64 [self addChildCoordinator:toolbarCoordinator]; | 63 [self addChildCoordinator:toolbarCoordinator]; |
65 // Unset the base view controller, so |toolbarCoordinator| doesn't present | 64 // Unset the base view controller, so |toolbarCoordinator| doesn't present |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 - (id<UIViewControllerAnimatedTransitioning>) | 149 - (id<UIViewControllerAnimatedTransitioning>) |
151 animationControllerForDismissedController:(UIViewController*)dismissed { | 150 animationControllerForDismissedController:(UIViewController*)dismissed { |
152 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init]; | 151 ZoomTransitionAnimator* animator = [[ZoomTransitionAnimator alloc] init]; |
153 animator.presenting = NO; | 152 animator.presenting = NO; |
154 animator.presentationKey = self.presentationKey; | 153 animator.presentationKey = self.presentationKey; |
155 [animator selectDelegate:@[ dismissed.presentingViewController ]]; | 154 [animator selectDelegate:@[ dismissed.presentingViewController ]]; |
156 return animator; | 155 return animator; |
157 } | 156 } |
158 | 157 |
159 @end | 158 @end |
OLD | NEW |