Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: ios/clean/chrome/browser/ui/root/root_coordinator.mm

Issue 2800313002: [ios] RootCoordinator and view controller. (Closed)
Patch Set: More unittests and cleanup. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "ios/clean/chrome/browser/ui/root/root_coordinator.h"
6
7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support."
9 #endif
10
11 #import "ios/clean/chrome/browser/ui/root/root_container_view_controller.h"
12 #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.h"
13 #import "ios/shared/chrome/browser/ui/browser_list/browser.h"
14 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal. h"
15
16 #if !defined(__has_feature) || !__has_feature(objc_arc)
17 #error "This file requires ARC support."
18 #endif
19
20 @interface RootCoordinator ()
21 @property(nonatomic, strong) RootContainerViewController* viewController;
22 @property(nonatomic, weak) TabGridCoordinator* tabGridCoordinator;
23 @end
24
25 @implementation RootCoordinator
26 @synthesize viewController = _viewController;
27 @synthesize tabGridCoordinator = _tabGridCoordinator;
28
29 #pragma mark - BrowserCoordinator
30
31 - (void)start {
32 self.viewController = [[RootContainerViewController alloc] init];
33
34 TabGridCoordinator* tabGridCoordinator = [[TabGridCoordinator alloc] init];
35 [self addChildCoordinator:tabGridCoordinator];
36 [tabGridCoordinator start];
37 self.tabGridCoordinator = tabGridCoordinator;
38
39 [super start];
40 }
41
42 - (void)stop {
43 [super stop];
44 // PLACEHOLDER: Stop child coordinators here for now. We might deal with this
45 // differently later on.
46 for (BrowserCoordinator* child in self.children) {
47 [child stop];
48 [self removeChildCoordinator:child];
49 }
50 }
51
52 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator {
53 self.viewController.contentViewController = childCoordinator.viewController;
54 }
55
56 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator {
57 self.viewController.contentViewController = nil;
58 }
59
60 - (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator {
61 return YES;
62 }
63
64 #pragma mark - URLOpening
65
66 - (void)openURL:(NSURL*)URL {
67 [self.tabGridCoordinator openURL:URL];
68 }
69
70 @end
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/root/root_coordinator.h ('k') | ios/clean/chrome/browser/ui/root/root_coordinator_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698