OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 5 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // static | 36 // static |
37 AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() { | 37 AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() { |
38 return base::Singleton<AppListSyncableServiceFactory>::get(); | 38 return base::Singleton<AppListSyncableServiceFactory>::get(); |
39 } | 39 } |
40 | 40 |
41 // static | 41 // static |
42 std::unique_ptr<KeyedService> AppListSyncableServiceFactory::BuildInstanceFor( | 42 std::unique_ptr<KeyedService> AppListSyncableServiceFactory::BuildInstanceFor( |
43 content::BrowserContext* browser_context) { | 43 content::BrowserContext* browser_context) { |
44 Profile* profile = static_cast<Profile*>(browser_context); | 44 Profile* profile = static_cast<Profile*>(browser_context); |
45 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 45 if (chromeos::ProfileHelper::IsSigninProfile(profile) || |
46 return NULL; | 46 chromeos::ProfileHelper::IsLockScreenAppProfile(profile)) { |
| 47 return nullptr; |
| 48 } |
47 VLOG(1) << "BuildInstanceFor: " << profile->GetDebugName() | 49 VLOG(1) << "BuildInstanceFor: " << profile->GetDebugName() |
48 << " (" << profile << ")"; | 50 << " (" << profile << ")"; |
49 return base::MakeUnique<AppListSyncableService>( | 51 return base::MakeUnique<AppListSyncableService>( |
50 profile, extensions::ExtensionSystem::Get(profile)); | 52 profile, extensions::ExtensionSystem::Get(profile)); |
51 } | 53 } |
52 | 54 |
53 // static | 55 // static |
54 void AppListSyncableServiceFactory::SetUseInTesting() { | 56 void AppListSyncableServiceFactory::SetUseInTesting() { |
55 use_in_testing = true; | 57 use_in_testing = true; |
56 } | 58 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // Start AppListSyncableService early so that the app list positions are | 98 // Start AppListSyncableService early so that the app list positions are |
97 // available before the app list is opened. | 99 // available before the app list is opened. |
98 return true; | 100 return true; |
99 } | 101 } |
100 | 102 |
101 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { | 103 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { |
102 return !use_in_testing; | 104 return !use_in_testing; |
103 } | 105 } |
104 | 106 |
105 } // namespace app_list | 107 } // namespace app_list |
OLD | NEW |