Commit 69cbe27e authored by lpromero's avatar lpromero Committed by Commit bot

Coordinators are now notified when moving to a parent coordinator.

BUG=none
R=rohitrao@chromium.org

Review-Url: https://codereview.chromium.org/2755653002
Cr-Commit-Position: refs/heads/master@{#457797}
parent 0485e8ec
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
// |coordinator| isn't a child of the receiver, this method does nothing. // |coordinator| isn't a child of the receiver, this method does nothing.
- (void)removeChildCoordinator:(BrowserCoordinator*)coordinator; - (void)removeChildCoordinator:(BrowserCoordinator*)coordinator;
// Called when this coordinator moves to a new parent coordinator. Subclasses
// can override this method to run code that requires a configured
// CoordinatorContext.
- (void)coordinatorDidMoveToParentCoordinator:
(BrowserCoordinator*)parentCoordinator;
// Called when a child coordinator did start. This is a blank template method. // Called when a child coordinator did start. This is a blank template method.
// Subclasses can override this method when they need to know when their // Subclasses can override this method when they need to know when their
// children start. // children start.
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
coordinator.parentCoordinator = self; coordinator.parentCoordinator = self;
coordinator.browser = self.browser; coordinator.browser = self.browser;
coordinator.context.baseViewController = self.viewController; coordinator.context.baseViewController = self.viewController;
[coordinator coordinatorDidMoveToParentCoordinator:self];
} }
- (BrowserCoordinator*)overlayCoordinator { - (BrowserCoordinator*)overlayCoordinator {
...@@ -126,6 +127,11 @@ ...@@ -126,6 +127,11 @@
coordinator.parentCoordinator = nil; coordinator.parentCoordinator = nil;
} }
- (void)coordinatorDidMoveToParentCoordinator:
(BrowserCoordinator*)parentCoordinator {
// Default implementation is a no-op.
}
- (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator { - (void)childCoordinatorDidStart:(BrowserCoordinator*)childCoordinator {
// Default implementation is a no-op. // Default implementation is a no-op.
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment