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/ntp/ntp_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/ntp/ntp_coordinator.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ios/chrome/browser/ui/ui_util.h" | 8 #include "ios/chrome/browser/ui/ui_util.h" |
9 #import "ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.h" | 9 #import "ios/clean/chrome/browser/ui/bookmarks/bookmarks_coordinator.h" |
10 #import "ios/clean/chrome/browser/ui/commands/ntp_commands.h" | 10 #import "ios/clean/chrome/browser/ui/commands/ntp_commands.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 [dispatcher startDispatchingToTarget:self | 40 [dispatcher startDispatchingToTarget:self |
41 forSelector:@selector(showNTPBookmarksPanel)]; | 41 forSelector:@selector(showNTPBookmarksPanel)]; |
42 [dispatcher startDispatchingToTarget:self | 42 [dispatcher startDispatchingToTarget:self |
43 forSelector:@selector(showNTPRecentTabsPanel)]; | 43 forSelector:@selector(showNTPRecentTabsPanel)]; |
44 self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); | 44 self.viewController.dispatcher = static_cast<id>(self.browser->dispatcher()); |
45 [super start]; | 45 [super start]; |
46 } | 46 } |
47 | 47 |
48 - (void)stop { | 48 - (void)stop { |
49 [super stop]; | 49 [super stop]; |
50 // PLACEHOLDER: Stop child coordinators here for now. We might deal with this | |
51 // differently later on. | |
52 for (BrowserCoordinator* child in self.children) { | |
53 [child stop]; | |
54 } | |
55 [self.browser->dispatcher() stopDispatchingToTarget:self]; | 50 [self.browser->dispatcher() stopDispatchingToTarget:self]; |
56 } | 51 } |
57 | 52 |
58 - (void)childCoordinatorDidStart:(BrowserCoordinator*)coordinator { | 53 - (void)childCoordinatorDidStart:(BrowserCoordinator*)coordinator { |
59 if ([coordinator isKindOfClass:[NTPHomeCoordinator class]]) { | 54 if ([coordinator isKindOfClass:[NTPHomeCoordinator class]]) { |
60 self.viewController.homeViewController = coordinator.viewController; | 55 self.viewController.homeViewController = coordinator.viewController; |
61 | 56 |
62 } else if ([coordinator isKindOfClass:[BookmarksCoordinator class]]) { | 57 } else if ([coordinator isKindOfClass:[BookmarksCoordinator class]]) { |
63 if (IsIPadIdiom()) { | 58 if (IsIPadIdiom()) { |
64 self.viewController.bookmarksViewController = coordinator.viewController; | 59 self.viewController.bookmarksViewController = coordinator.viewController; |
(...skipping 29 matching lines...) Expand all Loading... |
94 } | 89 } |
95 | 90 |
96 - (void)showNTPRecentTabsPanel { | 91 - (void)showNTPRecentTabsPanel { |
97 RecentTabsCoordinator* panelCoordinator = | 92 RecentTabsCoordinator* panelCoordinator = |
98 [[RecentTabsCoordinator alloc] init]; | 93 [[RecentTabsCoordinator alloc] init]; |
99 [self addChildCoordinator:panelCoordinator]; | 94 [self addChildCoordinator:panelCoordinator]; |
100 [panelCoordinator start]; | 95 [panelCoordinator start]; |
101 } | 96 } |
102 | 97 |
103 @end | 98 @end |
OLD | NEW |