Commit 5ca4ade7 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS][Signin] Fixing workflow when starting the sign-in in Recent Tabs

The SigninPromoViewMediator should not be deallocated until the sign-in
is finished. When the user clicks on "Continue as ...", the sign-in
is done as soon as the sign-in dialogs arrives.

RecentTabsTableViewController should not be updated as long as the
sign-in started by SigninPromoViewMediator is in progress.

Once the sign-in is done, the RecentTabsTableViewController can be
reloaded.

cronet;master.tryserver.chromium.mac:ios-simulator-full-configs

Bug: 798443
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I4a0937986e236473a7c0314c056cf437a0088c36
Reviewed-on: https://chromium-review.googlesource.com/846995
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526678}
parent 24ca9cd2
...@@ -251,4 +251,9 @@ ...@@ -251,4 +251,9 @@
[self.delegate updateNtpBarShadowForPanelController:self]; [self.delegate updateNtpBarShadowForPanelController:self];
} }
- (void)refreshSessionsViewRecentTabsTableViewController:
(RecentTabsTableViewController*)controller {
[self refreshSessionsView];
}
@end @end
...@@ -29,6 +29,10 @@ extern NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier; ...@@ -29,6 +29,10 @@ extern NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier;
@protocol RecentTabsTableViewControllerDelegate<NSObject> @protocol RecentTabsTableViewControllerDelegate<NSObject>
// Tells the delegate when the table view content scrolled or changed size. // Tells the delegate when the table view content scrolled or changed size.
- (void)recentTabsTableViewContentMoved:(UITableView*)tableView; - (void)recentTabsTableViewContentMoved:(UITableView*)tableView;
// Tells the delegate to refresh the session view.
- (void)refreshSessionsViewRecentTabsTableViewController:
(RecentTabsTableViewController*)controller;
@end @end
// Controls the content of a UITableView. // Controls the content of a UITableView.
......
...@@ -525,9 +525,10 @@ enum CellType { ...@@ -525,9 +525,10 @@ enum CellType {
#pragma mark - Distant Sessions helpers #pragma mark - Distant Sessions helpers
- (void)refreshUserState:(SessionsSyncUserState)newSessionState { - (void)refreshUserState:(SessionsSyncUserState)newSessionState {
if (newSessionState == _sessionState && if ((newSessionState == _sessionState &&
_sessionState != _sessionState !=
SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS) { SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS) ||
_signinPromoViewMediator.isSigninInProgress) {
// No need to refresh the sections. // No need to refresh the sections.
return; return;
} }
...@@ -1030,6 +1031,10 @@ enum CellType { ...@@ -1030,6 +1031,10 @@ enum CellType {
[configurator configureSigninPromoView:signinPromoView]; [configurator configureSigninPromoView:signinPromoView];
} }
- (void)signinDidFinish {
[self.delegate refreshSessionsViewRecentTabsTableViewController:self];
}
#pragma mark - SyncPresenter #pragma mark - SyncPresenter
- (void)showReauthenticateSignin { - (void)showReauthenticateSignin {
......
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