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

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 228553002: Preference dis/allowing supervised users creation is now available as owner setting, not only as de… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Logic for default settings moved to device_settings_provider. Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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
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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 return; 1832 return;
1837 1833
1838 chrome_client_id_ = chrome_client_id; 1834 chrome_client_id_ = chrome_client_id;
1839 chrome_client_secret_ = chrome_client_secret; 1835 chrome_client_secret_ = chrome_client_secret;
1840 } 1836 }
1841 1837
1842 bool UserManagerImpl::AreLocallyManagedUsersAllowed() const { 1838 bool UserManagerImpl::AreLocallyManagedUsersAllowed() const {
1843 bool locally_managed_users_allowed = false; 1839 bool locally_managed_users_allowed = false;
1844 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled, 1840 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled,
1845 &locally_managed_users_allowed); 1841 &locally_managed_users_allowed);
1846 policy::BrowserPolicyConnectorChromeOS* connector = 1842 return locally_managed_users_allowed;
1847 g_browser_process->platform_part()->browser_policy_connector_chromeos();
1848 return locally_managed_users_allowed || !connector->IsEnterpriseManaged();
1849 } 1843 }
1850 1844
1851 base::FilePath UserManagerImpl::GetUserProfileDir( 1845 base::FilePath UserManagerImpl::GetUserProfileDir(
1852 const std::string& user_id) const { 1846 const std::string& user_id) const {
1853 // TODO(dpolukhin): Remove Chrome OS specific profile path logic from 1847 // TODO(dpolukhin): Remove Chrome OS specific profile path logic from
1854 // ProfileManager and use only this function to construct profile path. 1848 // ProfileManager and use only this function to construct profile path.
1855 // TODO(nkostylev): Cleanup profile dir related code paths crbug.com/294233 1849 // TODO(nkostylev): Cleanup profile dir related code paths crbug.com/294233
1856 base::FilePath profile_dir; 1850 base::FilePath profile_dir;
1857 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 1851 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
1858 if (command_line.HasSwitch(::switches::kMultiProfiles)) { 1852 if (command_line.HasSwitch(::switches::kMultiProfiles)) {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 } 2078 }
2085 2079
2086 void UserManagerImpl::DeleteUser(User* user) { 2080 void UserManagerImpl::DeleteUser(User* user) {
2087 const bool is_active_user = (user == active_user_); 2081 const bool is_active_user = (user == active_user_);
2088 delete user; 2082 delete user;
2089 if (is_active_user) 2083 if (is_active_user)
2090 active_user_ = NULL; 2084 active_user_ = NULL;
2091 } 2085 }
2092 2086
2093 } // namespace chromeos 2087 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698