Skip to content

Commit

Permalink
[ios] Recent Tabs: Hook up delegate for immediate UI update after signin
Browse files Browse the repository at this point in the history
This needs to be hooked up so that the recent tabs
view controller immediately gets updated after coming
back from signin. Waiting for the synced session update
signal is not immediate enough.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I924156e8a76dfa4c702d7f8d0714a14588f74653
Reviewed-on: https://chromium-review.googlesource.com/1067246
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: Sergio Collazos <sczs@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560388}
  • Loading branch information
edx246 authored and Commit Bot committed May 21, 2018
1 parent ebcb92f commit 3307079
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ - (void)start {
// Set the consumer first before calling [self.mediator initObservers] and
// then [self.mediator reloadSessions].
self.mediator.consumer = recentTabsTableViewController;
recentTabsTableViewController.delegate = self.mediator;
[self.mediator initObservers];
[self.mediator reloadSessions];

Expand Down
4 changes: 4 additions & 0 deletions ios/chrome/browser/ui/recent_tabs/recent_tabs_mediator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ - (void)reloadSessionsData {
#pragma mark - RecentTabsTableViewControllerDelegate

- (void)refreshSessionsView {
// This method is called from two places: 1) when this mediator observes a
// change in the synced session state, and 2) when the UI layer recognizes
// that the signin process has completed. The latter call is necessary because
// it can happen much more immediately than the former call.
[self.consumer refreshUserState:[self userSignedInState]];
}

Expand Down

0 comments on commit 3307079

Please sign in to comment.