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

Unified Diff: ios/clean/chrome/browser/ui/tab/tab_coordinator.mm

Issue 2734333003: Child coordinators notify their parent upon -start and -stop. (Closed)
Patch Set: Feedback Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ios/clean/chrome/browser/ui/tab/tab_coordinator.mm
diff --git a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm
index 3ccbaa66b67e257ec66db055332433efb9e04f11..a821971055d3c240c7a8278f306aa8d35e2187f4 100644
--- a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm
+++ b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm
@@ -71,9 +71,6 @@ const BOOL kUseBottomToolbar = NO;
toolbarCoordinator.context.baseViewController = nil;
[toolbarCoordinator start];
- self.viewController.toolbarViewController = toolbarCoordinator.viewController;
- self.viewController.contentViewController = webCoordinator.viewController;
-
// PLACEHOLDER: Replace this placeholder with an actual tab strip view
// controller.
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
@@ -91,15 +88,25 @@ const BOOL kUseBottomToolbar = NO;
[self.context.baseViewController presentViewController:self.viewController
animated:self.context.animated
completion:nil];
+ [super start];
}
- (void)stop {
+ [super stop];
[self.viewController.presentingViewController
dismissViewControllerAnimated:self.context.animated
completion:nil];
_webStateObserver.reset();
}
+- (void)childCoordinatorDidStart:(BrowserCoordinator*)coordinator {
rohitrao (ping after 24h) 2017/03/08 19:01:45 Overall this lg. We can discuss whether to use is
+ if ([coordinator isKindOfClass:[ToolbarCoordinator class]]) {
+ self.viewController.toolbarViewController = coordinator.viewController;
+ } else if ([coordinator isKindOfClass:[WebCoordinator class]]) {
+ self.viewController.contentViewController = coordinator.viewController;
+ }
+}
+
- (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator {
// This coordinator will always accept overlay coordinators.
return YES;

Powered by Google App Engine
This is Rietveld 408576698