OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 5 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 8 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
9 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 9 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
10 #include "chrome/browser/chromeos/settings/device_settings_service.h" | 10 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 void OwnerSettingsServiceChromeOSFactory::SetOwnerKeyUtilForTesting( | 72 void OwnerSettingsServiceChromeOSFactory::SetOwnerKeyUtilForTesting( |
73 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util) { | 73 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util) { |
74 owner_key_util_ = owner_key_util; | 74 owner_key_util_ = owner_key_util; |
75 } | 75 } |
76 | 76 |
77 // static | 77 // static |
78 KeyedService* OwnerSettingsServiceChromeOSFactory::BuildInstanceFor( | 78 KeyedService* OwnerSettingsServiceChromeOSFactory::BuildInstanceFor( |
79 content::BrowserContext* browser_context) { | 79 content::BrowserContext* browser_context) { |
80 Profile* profile = static_cast<Profile*>(browser_context); | 80 Profile* profile = static_cast<Profile*>(browser_context); |
81 if (profile->IsGuestSession() || ProfileHelper::IsSigninProfile(profile)) | 81 if (profile->IsGuestSession() || ProfileHelper::IsSigninProfile(profile) || |
82 return NULL; | 82 ProfileHelper::IsLockScreenAppProfile(profile)) { |
| 83 return nullptr; |
| 84 } |
83 return new OwnerSettingsServiceChromeOS( | 85 return new OwnerSettingsServiceChromeOS( |
84 GetDeviceSettingsService(), | 86 GetDeviceSettingsService(), |
85 profile, | 87 profile, |
86 GetInstance()->GetOwnerKeyUtil()); | 88 GetInstance()->GetOwnerKeyUtil()); |
87 } | 89 } |
88 | 90 |
89 bool OwnerSettingsServiceChromeOSFactory::ServiceIsCreatedWithBrowserContext() | 91 bool OwnerSettingsServiceChromeOSFactory::ServiceIsCreatedWithBrowserContext() |
90 const { | 92 const { |
91 return true; | 93 return true; |
92 } | 94 } |
93 | 95 |
94 KeyedService* OwnerSettingsServiceChromeOSFactory::BuildServiceInstanceFor( | 96 KeyedService* OwnerSettingsServiceChromeOSFactory::BuildServiceInstanceFor( |
95 content::BrowserContext* context) const { | 97 content::BrowserContext* context) const { |
96 return BuildInstanceFor(context); | 98 return BuildInstanceFor(context); |
97 } | 99 } |
98 | 100 |
99 } // namespace chromeos | 101 } // namespace chromeos |
OLD | NEW |