Chromium Code Reviews| 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..4d896815288884b645e961f975358c880972b971 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::SetFactoryForSynctTest() { |
| + is_sync_test_ = true; |
| +} |
| + |
| ArcAppListPrefsFactory::ArcAppListPrefsFactory() |
| : BrowserContextKeyedServiceFactory( |
| "ArcAppListPrefs", |
| @@ -38,6 +45,11 @@ KeyedService* ArcAppListPrefsFactory::BuildServiceInstanceFor( |
| if (!arc::ArcAuthService::IsAllowedForProfile(profile)) |
| return nullptr; |
| + if (is_sync_test_) { |
|
lgcheng
2016/07/22 20:28:02
Luis@ Are use satisfied with this test setup for A
Luis Héctor Chávez
2016/07/25 17:56:24
Almost :) L50 will leak, you need to hold a unique
lgcheng
2016/07/25 20:45:32
unique_ptr holder added.
|
| + return ArcAppListPrefs::Create(profile, |
| + new arc::InstanceHolder<arc::mojom::AppInstance>()); |
| + } |
| + |
| arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); |
| if (!bridge_service) |
| return nullptr; |