Move AppRegistryCache::OnApps to the private method.
This CL is used to prepare for CL:4930449. We suggest using
AppServiceProxy::OnApps if possible, because there are some specific
handing for preference, app storage, etc in AppServiceProxy::OnApps.
So we move AppRegistryCache::OnApps to the private method to prevent
calling it from the production code.
For some tests without Profile, we provide OnAppsForTesting for
testing only, e.g. for unit tests.
Modify the test code to use AppServiceProxy::OnApps.
Modify app_registry_cache.cc to keep the consistent sequence as the
definition in app_registry_cache.h.
This CL is pure refactor, and no change on the production code.
BUG=1385932
Change-Id: I739d88e280d1e946f34f902f55e361e56351dd3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4933701
Commit-Queue: Nancy Wang <[email protected]>
Reviewed-by: Xiyuan Xia <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Yanzhu Du <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1210638}
diff --git a/chrome/browser/platform_util_unittest.cc b/chrome/browser/platform_util_unittest.cc
index d1703c9b..fe1a646 100644
--- a/chrome/browser/platform_util_unittest.cc
+++ b/chrome/browser/platform_util_unittest.cc
@@ -136,9 +136,8 @@
app->intent_filters =
apps_util::CreateIntentFiltersForChromeApp(extension.get());
apps.push_back(std::move(app));
- app_service_proxy_->AppRegistryCache().OnApps(
- std::move(apps), apps::AppType::kChromeApp,
- /*should_notify_initialized=*/false);
+ app_service_proxy_->OnApps(std::move(apps), apps::AppType::kChromeApp,
+ /*should_notify_initialized=*/false);
}
void SetUp() override {