Commit 432353f4 authored by Daniel Blakemore's avatar Daniel Blakemore Committed by Commit Bot

Use new mailto handling setup API.

Re-lands https://chromium-review.googlesource.com/1033019 after
fixes to downstream changes.

Bug: 810904
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I0b168ae145999d3269d910b77c6a770d86fb8ee0
Reviewed-on: https://chromium-review.googlesource.com/1034028Reviewed-by: default avatarPeter Lee <pkl@chromium.org>
Commit-Queue: Daniel Blakemore <danblakemore@google.com>
Cr-Commit-Position: refs/heads/master@{#554818}
parent 7308acaf
...@@ -1126,24 +1126,19 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1126,24 +1126,19 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
- (void)initializeMailtoHandling { - (void)initializeMailtoHandling {
if (base::FeatureList::IsEnabled(kMailtoHandledWithGoogleUI)) { if (base::FeatureList::IsEnabled(kMailtoHandledWithGoogleUI)) {
__weak __typeof(self) weakSelf = self;
[[DeferredInitializationRunner sharedInstance] [[DeferredInitializationRunner sharedInstance]
enqueueBlockNamed:kMailtoHandlingInitialization enqueueBlockNamed:kMailtoHandlingInitialization
block:^{ block:^{
__strong __typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
MailtoHandlerProvider* provider = MailtoHandlerProvider* provider =
ios::GetChromeBrowserProvider() ios::GetChromeBrowserProvider()
->GetMailtoHandlerProvider(); ->GetMailtoHandlerProvider();
ios::ChromeIdentityService* identityService =
ios::GetChromeBrowserProvider()
->GetChromeIdentityService();
provider->PrepareMailtoHandling( provider->PrepareMailtoHandling(
^ChromeIdentity* { strongSelf->_mainBrowserState);
// TODO:(crbug.com/810904) Replace with currently
// signed-in user.
return nil;
},
^NSArray<ChromeIdentity*>* {
return identityService->GetAllIdentities();
});
}]; }];
} }
} }
......
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