| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (self.webState->GetLastCommittedURL() == GURL(kChromeUINewTabURL)) { | 92 if (self.webState->GetLastCommittedURL() == GURL(kChromeUINewTabURL)) { |
| 93 self.viewController.contentViewController = | 93 self.viewController.contentViewController = |
| 94 self.ntpCoordinator.viewController; | 94 self.ntpCoordinator.viewController; |
| 95 } | 95 } |
| 96 | 96 |
| 97 [super start]; | 97 [super start]; |
| 98 } | 98 } |
| 99 | 99 |
| 100 - (void)stop { | 100 - (void)stop { |
| 101 [super stop]; | 101 [super stop]; |
| 102 // PLACEHOLDER: Stop child coordinators here for now. We might deal with this | |
| 103 // differently later on. | |
| 104 for (BrowserCoordinator* child in self.children) { | |
| 105 [child stop]; | |
| 106 } | |
| 107 _webStateObserver.reset(); | 102 _webStateObserver.reset(); |
| 108 [self.browser->dispatcher() stopDispatchingToTarget:self]; | 103 [self.browser->dispatcher() stopDispatchingToTarget:self]; |
| 109 } | 104 } |
| 110 | 105 |
| 111 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator { | 106 - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator { |
| 112 if ([childCoordinator isKindOfClass:[ToolbarCoordinator class]]) { | 107 if ([childCoordinator isKindOfClass:[ToolbarCoordinator class]]) { |
| 113 self.viewController.toolbarViewController = childCoordinator.viewController; | 108 self.viewController.toolbarViewController = childCoordinator.viewController; |
| 114 } else if ([childCoordinator isKindOfClass:[WebCoordinator class]] || | 109 } else if ([childCoordinator isKindOfClass:[WebCoordinator class]] || |
| 115 [childCoordinator isKindOfClass:[NTPCoordinator class]]) { | 110 [childCoordinator isKindOfClass:[NTPCoordinator class]]) { |
| 116 self.viewController.contentViewController = childCoordinator.viewController; | 111 self.viewController.contentViewController = childCoordinator.viewController; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return animator; | 189 return animator; |
| 195 } | 190 } |
| 196 | 191 |
| 197 #pragma mark - TabCommands | 192 #pragma mark - TabCommands |
| 198 | 193 |
| 199 - (void)loadURL:(web::NavigationManager::WebLoadParams)params { | 194 - (void)loadURL:(web::NavigationManager::WebLoadParams)params { |
| 200 self.webState->GetNavigationManager()->LoadURLWithParams(params); | 195 self.webState->GetNavigationManager()->LoadURLWithParams(params); |
| 201 } | 196 } |
| 202 | 197 |
| 203 @end | 198 @end |
| OLD | NEW |