OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/root/root_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/root/root_coordinator.h" |
6 | 6 |
7 #if !defined(__has_feature) || !__has_feature(objc_arc) | 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
8 #error "This file requires ARC support." | 8 #error "This file requires ARC support." |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... | |
32 self.viewController = [[RootContainerViewController alloc] init]; | 32 self.viewController = [[RootContainerViewController alloc] init]; |
33 | 33 |
34 TabGridCoordinator* tabGridCoordinator = [[TabGridCoordinator alloc] init]; | 34 TabGridCoordinator* tabGridCoordinator = [[TabGridCoordinator alloc] init]; |
35 [self addChildCoordinator:tabGridCoordinator]; | 35 [self addChildCoordinator:tabGridCoordinator]; |
36 [tabGridCoordinator start]; | 36 [tabGridCoordinator start]; |
37 self.tabGridCoordinator = tabGridCoordinator; | 37 self.tabGridCoordinator = tabGridCoordinator; |
38 | 38 |
39 [super start]; | 39 [super start]; |
40 } | 40 } |
41 | 41 |
42 - (void)stop { | 42 - (void)stop { |
marq (ping after 24h)
2017/04/18 12:13:26
can this whole method go away now?
lpromero
2017/05/03 13:13:23
No, to balance in stop the child coordinators addi
| |
43 [super stop]; | 43 [super stop]; |
44 // PLACEHOLDER: Stop child coordinators here for now. We might deal with this | 44 // PLACEHOLDER: Remove child coordinators here for now. This might be handled |
45 // differently later on. | 45 // differently later on. |
46 for (BrowserCoordinator* child in self.children) { | 46 for (BrowserCoordinator* child in self.children) { |
47 [child stop]; | |
48 [self removeChildCoordinator:child]; | 47 [self removeChildCoordinator:child]; |
49 } | 48 } |
50 } | 49 } |
51 | 50 |
52 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator { | 51 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator { |
53 self.viewController.contentViewController = childCoordinator.viewController; | 52 self.viewController.contentViewController = childCoordinator.viewController; |
54 } | 53 } |
55 | 54 |
56 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator { | 55 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator { |
57 self.viewController.contentViewController = nil; | 56 self.viewController.contentViewController = nil; |
58 } | 57 } |
59 | 58 |
60 - (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator { | 59 - (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator { |
61 return YES; | 60 return YES; |
62 } | 61 } |
63 | 62 |
64 #pragma mark - URLOpening | 63 #pragma mark - URLOpening |
65 | 64 |
66 - (void)openURL:(NSURL*)URL { | 65 - (void)openURL:(NSURL*)URL { |
67 [self.tabGridCoordinator openURL:URL]; | 66 [self.tabGridCoordinator openURL:URL]; |
68 } | 67 } |
69 | 68 |
70 @end | 69 @end |
OLD | NEW |