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

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

Issue 2800313002: [ios] RootCoordinator and view controller. (Closed)
Patch Set: Unittests, showcase, and clean up. 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 }
49 }
50
51 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator {
52 self.viewController.contentViewController = childCoordinator.viewController;
53 }
54
55 - (void)childCoordinatorWillStop:(BrowserCoordinator*)childCoordinator {
56 self.viewController.contentViewController = nil;
57 }
58
59 - (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator {
60 return YES;
61 }
62
63 #pragma mark - URLOpening
64
65 - (void)openURL:(NSURL*)URL {
66 [self.tabGridCoordinator openURL:URL];
67 }
68
69 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698