Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/child_accounts/child_account_service.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698