Commit e9663241 authored by Peter K. Lee's avatar Peter K. Lee Committed by Commit Bot

Use CheckForFirstPartyApps() from ChromeBrowserProvider

Switch to CheckForFirstPartyApps() instead of
GetNativeAppWhitelistManager().

Since this is the last use of the latter, it is removed from
ChromeBrowserProvider API as well.

Note that this depends on
https://chromereviews.googleplex.com/602627013/

Bug: 742617
Change-Id: I2df0461cdcc42b9729e7ae646b0a2fc26557133c
Reviewed-on: https://chromium-review.googlesource.com/570810Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Peter Lee <pkl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487143}
parent c45f951d
......@@ -179,7 +179,7 @@ NSString* const kMemoryDebuggingToolsStartup = @"MemoryDebuggingToolsStartup";
NSString* const kSendInstallPingIfNecessary = @"SendInstallPingIfNecessary";
// Constants for deferring check of native iOS apps installed.
NSString* const kCheckNativeApps = @"CheckNativeApps";
NSString* const kCheckForFirstPartyApps = @"CheckForFirstPartyApps";
// Constants for deferred deletion of leftover user downloaded files.
NSString* const kDeleteDownloads = @"DeleteDownloads";
......@@ -455,8 +455,9 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
// Asynchronously creates the pref observers.
- (void)schedulePrefObserverInitialization;
// Asynchronously schedules a check for what other native iOS apps are currently
// installed.
- (void)scheduleCheckNativeApps;
// installed. Note that there may be App Store restrictions around checking for
// native iOS apps not owned by the browser vendor.
- (void)scheduleCheckForFirstPartyApps;
// Asynchronously schedules pings to distribution services.
- (void)scheduleAppDistributionPings;
// Asynchronously schedule the init of the memoryDebuggerManager.
......@@ -1016,14 +1017,12 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
}];
}
- (void)scheduleCheckNativeApps {
void (^checkInstalledApps)(void) = ^{
[ios::GetChromeBrowserProvider()->GetNativeAppWhitelistManager()
checkInstalledApps];
};
- (void)scheduleCheckForFirstPartyApps {
[[DeferredInitializationRunner sharedInstance]
enqueueBlockNamed:kCheckNativeApps
block:checkInstalledApps];
enqueueBlockNamed:kCheckForFirstPartyApps
block:^{
ios::GetChromeBrowserProvider()->CheckForFirstPartyApps();
}];
}
- (void)scheduleAppDistributionPings {
......@@ -1152,7 +1151,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
[self scheduleStartupAttemptReset];
[self startFreeMemoryMonitoring];
[self scheduleAppDistributionPings];
[self scheduleCheckNativeApps];
[self scheduleCheckForFirstPartyApps];
}
- (void)scheduleTasksRequiringBVCWithBrowserState {
......
......@@ -144,9 +144,6 @@ class ChromeBrowserProvider {
// Returns an instance of the branded image provider.
virtual BrandedImageProvider* GetBrandedImageProvider() const;
// Returns the NativeAppWhitelistManager implementation.
virtual id<NativeAppWhitelistManager> GetNativeAppWhitelistManager() const;
// Hides immediately the modals related to this provider.
virtual void HideModalViewStack() const;
......
......@@ -114,11 +114,6 @@ BrandedImageProvider* ChromeBrowserProvider::GetBrandedImageProvider() const {
return nullptr;
}
id<NativeAppWhitelistManager>
ChromeBrowserProvider::GetNativeAppWhitelistManager() const {
return nil;
}
void ChromeBrowserProvider::HideModalViewStack() const {}
void ChromeBrowserProvider::LogIfModalViewsArePresented() const {}
......
......@@ -35,7 +35,6 @@ class TestChromeBrowserProvider : public ChromeBrowserProvider {
SpotlightProvider* GetSpotlightProvider() const override;
void CheckForFirstPartyApps() const override;
BrandedImageProvider* GetBrandedImageProvider() const override;
id<NativeAppWhitelistManager> GetNativeAppWhitelistManager() const override;
private:
std::unique_ptr<AppDistributionProvider> app_distribution_provider_;
......
......@@ -97,9 +97,4 @@ BrandedImageProvider* TestChromeBrowserProvider::GetBrandedImageProvider()
return branded_image_provider_.get();
}
id<NativeAppWhitelistManager>
TestChromeBrowserProvider::GetNativeAppWhitelistManager() const {
return nil;
}
} // namespace ios
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