| Index: ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm
|
| diff --git a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm
|
| index 2917b4237b808a2ad82137c13726f5cae6fe5f7a..3a2a3b1df5502a8a8a8c85f438dcd9b730fb652b 100644
|
| --- a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm
|
| +++ b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm
|
| @@ -18,7 +18,6 @@ @interface BrowserCoordinator ()
|
| // Parent coordinator of this object, if any.
|
| @property(nonatomic, readwrite, weak) BrowserCoordinator* parentCoordinator;
|
| @property(nonatomic, readwrite) BOOL started;
|
| -@property(nonatomic, readwrite) BOOL overlaying;
|
| @end
|
|
|
| @implementation BrowserCoordinator
|
| @@ -27,7 +26,6 @@ @implementation BrowserCoordinator
|
| @synthesize childCoordinators = _childCoordinators;
|
| @synthesize parentCoordinator = _parentCoordinator;
|
| @synthesize started = _started;
|
| -@synthesize overlaying = _overlaying;
|
|
|
| - (instancetype)init {
|
| if (self = [super init]) {
|
| @@ -83,51 +81,6 @@ - (void)addChildCoordinator:(BrowserCoordinator*)childCoordinator {
|
| [childCoordinator wasAddedToParentCoordinator:self];
|
| }
|
|
|
| -- (BrowserCoordinator*)overlayCoordinator {
|
| - if (self.overlaying)
|
| - return self;
|
| - for (BrowserCoordinator* child in self.children) {
|
| - BrowserCoordinator* overlay = child.overlayCoordinator;
|
| - if (overlay)
|
| - return overlay;
|
| - }
|
| - return nil;
|
| -}
|
| -
|
| -- (void)addOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator {
|
| - // If this object has no children, then add |overlayCoordinator| as a child
|
| - // and mark it as such.
|
| - if ([self canAddOverlayCoordinator:overlayCoordinator]) {
|
| - [self addChildCoordinator:overlayCoordinator];
|
| - overlayCoordinator.overlaying = YES;
|
| - } else if (self.childCoordinators.count == 1) {
|
| - [[self.childCoordinators anyObject]
|
| - addOverlayCoordinator:overlayCoordinator];
|
| - } else if (self.childCoordinators.count > 1) {
|
| - CHECK(NO) << "Coordinators with multiple children must explicitly "
|
| - << "handle -addOverlayCoordinator: or return NO to "
|
| - << "-canAddOverlayCoordinator:";
|
| - }
|
| - // If control reaches here, the terminal child of the coordinator hierarchy
|
| - // has returned NO to -canAddOverlayCoordinator, so no overlay can be added.
|
| - // This is by default a silent no-op.
|
| -}
|
| -
|
| -- (void)removeOverlayCoordinator {
|
| - BrowserCoordinator* overlay = self.overlayCoordinator;
|
| - [overlay.parentCoordinator removeChildCoordinator:overlay];
|
| - overlay.overlaying = NO;
|
| -}
|
| -
|
| -- (BOOL)canAddOverlayCoordinator:(BrowserCoordinator*)overlayCoordinator {
|
| - // By default, a hierarchy with an overlay can't add a new one.
|
| - // By default, coordinators with parents can't be added as overlays.
|
| - // By default, coordinators with no other children can add an overlay.
|
| - return self.overlayCoordinator == nil &&
|
| - overlayCoordinator.parentCoordinator == nil &&
|
| - self.childCoordinators.count == 0;
|
| -}
|
| -
|
| - (void)removeChildCoordinator:(BrowserCoordinator*)childCoordinator {
|
| if (![self.childCoordinators containsObject:childCoordinator])
|
| return;
|
|
|