OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/chromeos/login/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 223 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
224 content::NotificationService::AllSources()); | 224 content::NotificationService::AllSources()); |
225 registrar_.Add(this, | 225 registrar_.Add(this, |
226 chrome::NOTIFICATION_PROFILE_CREATED, | 226 chrome::NOTIFICATION_PROFILE_CREATED, |
227 content::NotificationService::AllSources()); | 227 content::NotificationService::AllSources()); |
228 RetrieveTrustedDevicePolicies(); | 228 RetrieveTrustedDevicePolicies(); |
229 local_accounts_subscription_ = cros_settings_->AddSettingsObserver( | 229 local_accounts_subscription_ = cros_settings_->AddSettingsObserver( |
230 kAccountsPrefDeviceLocalAccounts, | 230 kAccountsPrefDeviceLocalAccounts, |
231 base::Bind(&UserManagerImpl::RetrieveTrustedDevicePolicies, | 231 base::Bind(&UserManagerImpl::RetrieveTrustedDevicePolicies, |
232 base::Unretained(this))); | 232 base::Unretained(this))); |
233 supervised_users_subscription_ = cros_settings_->AddSettingsObserver( | |
234 kAccountsPrefSupervisedUsersEnabled, | |
235 base::Bind(&UserManagerImpl::RetrieveTrustedDevicePolicies, | |
236 base::Unretained(this))); | |
237 multi_profile_user_controller_.reset(new MultiProfileUserController( | 233 multi_profile_user_controller_.reset(new MultiProfileUserController( |
238 this, g_browser_process->local_state())); | 234 this, g_browser_process->local_state())); |
239 | 235 |
240 policy::BrowserPolicyConnectorChromeOS* connector = | 236 policy::BrowserPolicyConnectorChromeOS* connector = |
241 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 237 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
242 avatar_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver( | 238 avatar_policy_observer_.reset(new policy::CloudExternalDataPolicyObserver( |
243 cros_settings_, | 239 cros_settings_, |
244 this, | 240 this, |
245 connector->GetDeviceLocalAccountPolicyService(), | 241 connector->GetDeviceLocalAccountPolicyService(), |
246 policy::key::kUserAvatarImage, | 242 policy::key::kUserAvatarImage, |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1827 const std::string& chrome_client_id, | 1823 const std::string& chrome_client_id, |
1828 const std::string& chrome_client_secret) { | 1824 const std::string& chrome_client_secret) { |
1829 if (!chrome::IsRunningInForcedAppMode()) | 1825 if (!chrome::IsRunningInForcedAppMode()) |
1830 return; | 1826 return; |
1831 | 1827 |
1832 chrome_client_id_ = chrome_client_id; | 1828 chrome_client_id_ = chrome_client_id; |
1833 chrome_client_secret_ = chrome_client_secret; | 1829 chrome_client_secret_ = chrome_client_secret; |
1834 } | 1830 } |
1835 | 1831 |
1836 bool UserManagerImpl::AreLocallyManagedUsersAllowed() const { | 1832 bool UserManagerImpl::AreLocallyManagedUsersAllowed() const { |
1837 bool locally_managed_users_allowed = false; | 1833 bool locally_managed_users_allowed = true; |
Nikita (slow)
2014/04/08 14:02:09
As discussed: this is not the correct way to set t
merkulova
2014/04/09 15:24:19
Done.
| |
1838 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled, | 1834 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled, |
1839 &locally_managed_users_allowed); | 1835 &locally_managed_users_allowed); |
1840 policy::BrowserPolicyConnectorChromeOS* connector = | 1836 return locally_managed_users_allowed; |
1841 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
1842 return locally_managed_users_allowed || !connector->IsEnterpriseManaged(); | |
1843 } | 1837 } |
1844 | 1838 |
1845 base::FilePath UserManagerImpl::GetUserProfileDir( | 1839 base::FilePath UserManagerImpl::GetUserProfileDir( |
1846 const std::string& user_id) const { | 1840 const std::string& user_id) const { |
1847 // TODO(dpolukhin): Remove Chrome OS specific profile path logic from | 1841 // TODO(dpolukhin): Remove Chrome OS specific profile path logic from |
1848 // ProfileManager and use only this function to construct profile path. | 1842 // ProfileManager and use only this function to construct profile path. |
1849 // TODO(nkostylev): Cleanup profile dir related code paths crbug.com/294233 | 1843 // TODO(nkostylev): Cleanup profile dir related code paths crbug.com/294233 |
1850 base::FilePath profile_dir; | 1844 base::FilePath profile_dir; |
1851 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1845 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1852 if (command_line.HasSwitch(::switches::kMultiProfiles)) { | 1846 if (command_line.HasSwitch(::switches::kMultiProfiles)) { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2078 } | 2072 } |
2079 | 2073 |
2080 void UserManagerImpl::DeleteUser(User* user) { | 2074 void UserManagerImpl::DeleteUser(User* user) { |
2081 const bool is_active_user = (user == active_user_); | 2075 const bool is_active_user = (user == active_user_); |
2082 delete user; | 2076 delete user; |
2083 if (is_active_user) | 2077 if (is_active_user) |
2084 active_user_ = NULL; | 2078 active_user_ = NULL; |
2085 } | 2079 } |
2086 | 2080 |
2087 } // namespace chromeos | 2081 } // namespace chromeos |
OLD | NEW |