| Index: chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
|
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
|
| index 6ac101e160efa0f98dbb1631ae1810da9d33109a..fecaf94a69081c5224dfa18fb9ed1528f823f1b5 100644
|
| --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
|
| +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.cc
|
| @@ -11,6 +11,8 @@
|
| #include "components/keyed_service/content/browser_context_dependency_manager.h"
|
| #include "content/public/browser/browser_context.h"
|
|
|
| +bool ArcAppListPrefsFactory::is_sync_test_ = false;
|
| +
|
| // static
|
| ArcAppListPrefs* ArcAppListPrefsFactory::GetForBrowserContext(
|
| content::BrowserContext* context) {
|
| @@ -23,6 +25,11 @@ ArcAppListPrefsFactory* ArcAppListPrefsFactory::GetInstance() {
|
| return base::Singleton<ArcAppListPrefsFactory>::get();
|
| }
|
|
|
| +// static
|
| +void ArcAppListPrefsFactory::SetFactoryForSyncTest() {
|
| + is_sync_test_ = true;
|
| +}
|
| +
|
| ArcAppListPrefsFactory::ArcAppListPrefsFactory()
|
| : BrowserContextKeyedServiceFactory(
|
| "ArcAppListPrefs",
|
| @@ -38,6 +45,13 @@ KeyedService* ArcAppListPrefsFactory::BuildServiceInstanceFor(
|
| if (!arc::ArcAuthService::IsAllowedForProfile(profile))
|
| return nullptr;
|
|
|
| + if (is_sync_test_) {
|
| + sync_test_app_instance_holders_[context].reset(
|
| + new arc::InstanceHolder<arc::mojom::AppInstance>());
|
| + return ArcAppListPrefs::Create(
|
| + profile, sync_test_app_instance_holders_[context].get());
|
| + }
|
| +
|
| arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get();
|
| if (!bridge_service)
|
| return nullptr;
|
|
|