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