Skip to content

Commit

Permalink
Remove some outdated code
Browse files Browse the repository at this point in the history
- Accounts do not need to be reloaded on every foreground, as it already
  happens when the app starts. The original comment on access tokens was
  inaccurate as well.

- No need to invoke network initialized anymore since cc name fixer flows
  were removed.

Change-Id: Id801a6f04f5c8042bf95a4d4af1225e2fa7257bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4363342
Reviewed-by: Hiroshi Ichikawa <ichikawa@chromium.org>
Commit-Queue: John Wu <jzw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1121433}
  • Loading branch information
John Wu authored and Chromium LUCI CQ committed Mar 23, 2023
1 parent 839f30c commit 5274bb5
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions ios/web_view/internal/sync/cwv_sync_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ - (void)didShutdownSync;
// Called by WebViewSyncControllerObserverBridge's |OnStateChanged|.
- (void)syncStateDidChange;

// Call to reload accounts from the |dataSource|.
- (void)reloadAccounts;

@end

namespace ios_web_view {
Expand Down Expand Up @@ -104,18 +101,6 @@ - (instancetype)initWithSyncService:(syncer::SyncService*)syncService
std::make_unique<ios_web_view::WebViewSyncControllerObserverBridge>(
self);
_syncService->AddObserver(_observer.get());

// Refresh access tokens on foreground to extend expiration dates.
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(reloadAccounts)
name:UIApplicationWillEnterForegroundNotification
object:nil];

// This allows internals of |_identityManager| to fetch and store the user's
// info and profile image. This must be called manually *after* all services
// have been started to avoid issues in https://crbug.com/441399.
_identityManager->OnNetworkInitialized();
}
return self;
}
Expand Down Expand Up @@ -218,11 +203,4 @@ - (void)syncStateDidChange {
}
}

- (void)reloadAccounts {
_identityManager->GetDeviceAccountsSynchronizer()
->ReloadAllAccountsFromSystemWithPrimaryAccount(
_identityManager->GetPrimaryAccountInfo(signin::ConsentLevel::kSync)
.account_id);
}

@end

0 comments on commit 5274bb5

Please sign in to comment.