Commit 65f4610a authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Rename navigationController to baseNavigationController

This is done to make clear what is the purpose of the navigation
controller.

Bug: None
Change-Id: I8207f16e4b8551b7d568bf017880bb9814c70bbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091529
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748509}
parent c2e67e4e
...@@ -67,7 +67,7 @@ using l10n_util::GetNSString; ...@@ -67,7 +67,7 @@ using l10n_util::GetNSString;
initWithBaseViewController:self.advancedSettingsSigninNavigationController initWithBaseViewController:self.advancedSettingsSigninNavigationController
browser:self.browser browser:self.browser
mode:mode]; mode:mode];
self.googleServicesSettingsCoordinator.navigationController = self.googleServicesSettingsCoordinator.baseNavigationController =
self.advancedSettingsSigninNavigationController; self.advancedSettingsSigninNavigationController;
[self.googleServicesSettingsCoordinator start]; [self.googleServicesSettingsCoordinator start];
......
...@@ -44,8 +44,10 @@ typedef NSMutableArray<ChromeCoordinator*> MutableCoordinatorArray; ...@@ -44,8 +44,10 @@ typedef NSMutableArray<ChromeCoordinator*> MutableCoordinatorArray;
// The view controller this coordinator was initialized with. // The view controller this coordinator was initialized with.
@property(weak, nonatomic, readonly) UIViewController* baseViewController; @property(weak, nonatomic, readonly) UIViewController* baseViewController;
// The navigation controller this coordinator was initialized with. // Parent coordinator can set this to allow the child coordinator to push their
@property(weak, nonatomic) UINavigationController* navigationController; // view controller to the navigationController instead of presenting it if
// needed. This is usually the same object as |baseViewController|.
@property(weak, nonatomic) UINavigationController* baseNavigationController;
// The coordinator's BrowserState. // The coordinator's BrowserState.
@property(assign, nonatomic, readonly) ChromeBrowserState* browserState; @property(assign, nonatomic, readonly) ChromeBrowserState* browserState;
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
// Called when the dismissal of the modal UI is finished. // Called when the dismissal of the modal UI is finished.
- (void)finishDismissal { - (void)finishDismissal {
[self resetModal]; [self resetModal];
self.navigationController = nil; self.modalNavController = nil;
// Notify the presentation context that the dismissal has finished. This // Notify the presentation context that the dismissal has finished. This
// is necessary to synchronize OverlayPresenter scheduling logic with the UI // is necessary to synchronize OverlayPresenter scheduling logic with the UI
// layer. // layer.
......
...@@ -103,9 +103,9 @@ ...@@ -103,9 +103,9 @@
ProfileSyncServiceFactory::GetForBrowserState(self.browserState); ProfileSyncServiceFactory::GetForBrowserState(self.browserState);
viewController.modelDelegate = self.mediator; viewController.modelDelegate = self.mediator;
viewController.serviceDelegate = self.mediator; viewController.serviceDelegate = self.mediator;
DCHECK(self.navigationController); DCHECK(self.baseNavigationController);
[self.navigationController pushViewController:self.viewController [self.baseNavigationController pushViewController:self.viewController
animated:YES]; animated:YES];
} }
- (void)stop { - (void)stop {
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
controller.dispatcher = static_cast< controller.dispatcher = static_cast<
id<ApplicationCommands, BrowserCommands, BrowsingDataCommands>>( id<ApplicationCommands, BrowserCommands, BrowsingDataCommands>>(
self.browser->GetCommandDispatcher()); self.browser->GetCommandDispatcher());
[self.navigationController pushViewController:controller animated:YES]; [self.baseNavigationController pushViewController:controller animated:YES];
} }
- (void)showSignIn { - (void)showSignIn {
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
ACCESS_POINT_GOOGLE_SERVICES_SETTINGS ACCESS_POINT_GOOGLE_SERVICES_SETTINGS
promoAction:signin_metrics::PromoAction:: promoAction:signin_metrics::PromoAction::
PROMO_ACTION_NO_SIGNIN_PROMO PROMO_ACTION_NO_SIGNIN_PROMO
presentingViewController:self.navigationController presentingViewController:self.baseNavigationController
completion:^(BOOL success) { completion:^(BOOL success) {
[weakSelf signInInteractionCoordinatorDidComplete]; [weakSelf signInInteractionCoordinatorDidComplete];
}]; }];
...@@ -235,7 +235,7 @@ ...@@ -235,7 +235,7 @@
AccountsTableViewController* controller = AccountsTableViewController* controller =
[[AccountsTableViewController alloc] initWithBrowser:self.browser [[AccountsTableViewController alloc] initWithBrowser:self.browser
closeSettingsOnAddAccount:NO]; closeSettingsOnAddAccount:NO];
[self.navigationController pushViewController:controller animated:YES]; [self.baseNavigationController pushViewController:controller animated:YES];
} }
- (void)openManageSyncSettings { - (void)openManageSyncSettings {
...@@ -243,8 +243,8 @@ ...@@ -243,8 +243,8 @@
self.manageSyncSettingsCoordinator = [[ManageSyncSettingsCoordinator alloc] self.manageSyncSettingsCoordinator = [[ManageSyncSettingsCoordinator alloc]
initWithBaseViewController:self.viewController initWithBaseViewController:self.viewController
browser:self.browser]; browser:self.browser];
self.manageSyncSettingsCoordinator.navigationController = self.manageSyncSettingsCoordinator.baseNavigationController =
self.navigationController; self.baseNavigationController;
self.manageSyncSettingsCoordinator.delegate = self; self.manageSyncSettingsCoordinator.delegate = self;
[self.manageSyncSettingsCoordinator start]; [self.manageSyncSettingsCoordinator start];
} }
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@implementation ManageSyncSettingsCoordinator @implementation ManageSyncSettingsCoordinator
- (void)start { - (void)start {
DCHECK(self.navigationController); DCHECK(self.baseNavigationController);
self.mediator = [[ManageSyncSettingsMediator alloc] self.mediator = [[ManageSyncSettingsMediator alloc]
initWithSyncService:self.syncService initWithSyncService:self.syncService
userPrefService:self.browserState->GetPrefs()]; userPrefService:self.browserState->GetPrefs()];
...@@ -75,8 +75,8 @@ ...@@ -75,8 +75,8 @@
self.viewController.presentationDelegate = self; self.viewController.presentationDelegate = self;
self.viewController.modelDelegate = self.mediator; self.viewController.modelDelegate = self.mediator;
self.mediator.consumer = self.viewController; self.mediator.consumer = self.viewController;
[self.navigationController pushViewController:self.viewController [self.baseNavigationController pushViewController:self.viewController
animated:YES]; animated:YES];
_syncObserver.reset(new SyncObserverBridge(self, self.syncService)); _syncObserver.reset(new SyncObserverBridge(self, self.syncService));
} }
...@@ -95,9 +95,9 @@ ...@@ -95,9 +95,9 @@
self.dismissWebAndAppSettingDetailsControllerBlock(NO); self.dismissWebAndAppSettingDetailsControllerBlock(NO);
self.dismissWebAndAppSettingDetailsControllerBlock = nil; self.dismissWebAndAppSettingDetailsControllerBlock = nil;
} }
[self.navigationController popToViewController:self.viewController [self.baseNavigationController popToViewController:self.viewController
animated:NO]; animated:NO];
[self.navigationController popViewControllerAnimated:YES]; [self.baseNavigationController popViewControllerAnimated:YES];
} }
} }
...@@ -140,7 +140,8 @@ ...@@ -140,7 +140,8 @@
controllerToPush.dispatcher = static_cast< controllerToPush.dispatcher = static_cast<
id<ApplicationCommands, BrowserCommands, BrowsingDataCommands>>( id<ApplicationCommands, BrowserCommands, BrowsingDataCommands>>(
self.browser->GetCommandDispatcher()); self.browser->GetCommandDispatcher());
[self.navigationController pushViewController:controllerToPush animated:YES]; [self.baseNavigationController pushViewController:controllerToPush
animated:YES];
} }
- (void)openWebAppActivityDialog { - (void)openWebAppActivityDialog {
......
...@@ -369,7 +369,7 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId"; ...@@ -369,7 +369,7 @@ NSString* const kSettingsDoneButtonId = @"kSettingsDoneButtonId";
initWithBaseViewController:self initWithBaseViewController:self
browser:self.browser browser:self.browser
mode:GoogleServicesSettingsModeSettings]; mode:GoogleServicesSettingsModeSettings];
self.googleServicesSettingsCoordinator.navigationController = self; self.googleServicesSettingsCoordinator.baseNavigationController = self;
self.googleServicesSettingsCoordinator.delegate = self; self.googleServicesSettingsCoordinator.delegate = self;
[self.googleServicesSettingsCoordinator start]; [self.googleServicesSettingsCoordinator start];
} }
......
...@@ -925,7 +925,7 @@ NSString* kDevViewSourceKey = @"DevViewSource"; ...@@ -925,7 +925,7 @@ NSString* kDevViewSourceKey = @"DevViewSource";
initWithBaseViewController:self.navigationController initWithBaseViewController:self.navigationController
browser:_browser browser:_browser
mode:GoogleServicesSettingsModeSettings]; mode:GoogleServicesSettingsModeSettings];
_googleServicesSettingsCoordinator.navigationController = _googleServicesSettingsCoordinator.baseNavigationController =
self.navigationController; self.navigationController;
_googleServicesSettingsCoordinator.delegate = self; _googleServicesSettingsCoordinator.delegate = self;
[_googleServicesSettingsCoordinator start]; [_googleServicesSettingsCoordinator start];
......
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