| 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/login/users/chrome_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 : ChromeUserManager(base::ThreadTaskRunnerHandle::Get(), | 102 : ChromeUserManager(base::ThreadTaskRunnerHandle::Get(), |
| 103 BrowserThread::GetBlockingPool()), | 103 BrowserThread::GetBlockingPool()), |
| 104 cros_settings_(CrosSettings::Get()), | 104 cros_settings_(CrosSettings::Get()), |
| 105 device_local_account_policy_service_(NULL), | 105 device_local_account_policy_service_(NULL), |
| 106 supervised_user_manager_(new SupervisedUserManagerImpl(this)), | 106 supervised_user_manager_(new SupervisedUserManagerImpl(this)), |
| 107 bootstrap_manager_(new BootstrapManager(this)), | 107 bootstrap_manager_(new BootstrapManager(this)), |
| 108 weak_factory_(this) { | 108 weak_factory_(this) { |
| 109 UpdateNumberOfUsers(); | 109 UpdateNumberOfUsers(); |
| 110 | 110 |
| 111 // UserManager instance should be used only on UI thread. | 111 // UserManager instance should be used only on UI thread. |
| 112 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 112 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 113 registrar_.Add(this, | 113 registrar_.Add(this, |
| 114 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED, | 114 chrome::NOTIFICATION_OWNERSHIP_STATUS_CHANGED, |
| 115 content::NotificationService::AllSources()); | 115 content::NotificationService::AllSources()); |
| 116 registrar_.Add(this, | 116 registrar_.Add(this, |
| 117 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 117 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 118 content::NotificationService::AllSources()); | 118 content::NotificationService::AllSources()); |
| 119 registrar_.Add(this, | 119 registrar_.Add(this, |
| 120 chrome::NOTIFICATION_PROFILE_CREATED, | 120 chrome::NOTIFICATION_PROFILE_CREATED, |
| 121 content::NotificationService::AllSources()); | 121 content::NotificationService::AllSources()); |
| 122 | 122 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 149 connector->GetDeviceLocalAccountPolicyService(), | 149 connector->GetDeviceLocalAccountPolicyService(), |
| 150 policy::key::kWallpaperImage, | 150 policy::key::kWallpaperImage, |
| 151 this)); | 151 this)); |
| 152 wallpaper_policy_observer_->Init(); | 152 wallpaper_policy_observer_->Init(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 ChromeUserManagerImpl::~ChromeUserManagerImpl() { | 155 ChromeUserManagerImpl::~ChromeUserManagerImpl() { |
| 156 } | 156 } |
| 157 | 157 |
| 158 void ChromeUserManagerImpl::Shutdown() { | 158 void ChromeUserManagerImpl::Shutdown() { |
| 159 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 159 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 160 ChromeUserManager::Shutdown(); | 160 ChromeUserManager::Shutdown(); |
| 161 | 161 |
| 162 local_accounts_subscription_.reset(); | 162 local_accounts_subscription_.reset(); |
| 163 | 163 |
| 164 // Stop the session length limiter. | 164 // Stop the session length limiter. |
| 165 session_length_limiter_.reset(); | 165 session_length_limiter_.reset(); |
| 166 | 166 |
| 167 if (device_local_account_policy_service_) | 167 if (device_local_account_policy_service_) |
| 168 device_local_account_policy_service_->RemoveObserver(this); | 168 device_local_account_policy_service_->RemoveObserver(this); |
| 169 | 169 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 NOTREACHED() | 282 NOTREACHED() |
| 283 << "Spotted primary-only multi-profile policy for non-primary user"; | 283 << "Spotted primary-only multi-profile policy for non-primary user"; |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 return unlock_users; | 288 return unlock_users; |
| 289 } | 289 } |
| 290 | 290 |
| 291 void ChromeUserManagerImpl::SessionStarted() { | 291 void ChromeUserManagerImpl::SessionStarted() { |
| 292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 292 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 293 ChromeUserManager::SessionStarted(); | 293 ChromeUserManager::SessionStarted(); |
| 294 | 294 |
| 295 content::NotificationService::current()->Notify( | 295 content::NotificationService::current()->Notify( |
| 296 chrome::NOTIFICATION_SESSION_STARTED, | 296 chrome::NOTIFICATION_SESSION_STARTED, |
| 297 content::Source<UserManager>(this), | 297 content::Source<UserManager>(this), |
| 298 content::Details<const user_manager::User>(GetActiveUser())); | 298 content::Details<const user_manager::User>(GetActiveUser())); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void ChromeUserManagerImpl::RemoveUserInternal( | 301 void ChromeUserManagerImpl::RemoveUserInternal( |
| 302 const std::string& user_email, | 302 const std::string& user_email, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 321 if (user_email == owner) { | 321 if (user_email == owner) { |
| 322 // Owner is not allowed to be removed from the device. | 322 // Owner is not allowed to be removed from the device. |
| 323 return; | 323 return; |
| 324 } | 324 } |
| 325 RemoveNonOwnerUserInternal(user_email, delegate); | 325 RemoveNonOwnerUserInternal(user_email, delegate); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void ChromeUserManagerImpl::SaveUserOAuthStatus( | 328 void ChromeUserManagerImpl::SaveUserOAuthStatus( |
| 329 const std::string& user_id, | 329 const std::string& user_id, |
| 330 user_manager::User::OAuthTokenStatus oauth_token_status) { | 330 user_manager::User::OAuthTokenStatus oauth_token_status) { |
| 331 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 331 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 332 ChromeUserManager::SaveUserOAuthStatus(user_id, oauth_token_status); | 332 ChromeUserManager::SaveUserOAuthStatus(user_id, oauth_token_status); |
| 333 | 333 |
| 334 GetUserFlow(user_id)->HandleOAuthTokenStatusChange(oauth_token_status); | 334 GetUserFlow(user_id)->HandleOAuthTokenStatusChange(oauth_token_status); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void ChromeUserManagerImpl::SaveUserDisplayName( | 337 void ChromeUserManagerImpl::SaveUserDisplayName( |
| 338 const std::string& user_id, | 338 const std::string& user_id, |
| 339 const base::string16& display_name) { | 339 const base::string16& display_name) { |
| 340 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 340 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 341 ChromeUserManager::SaveUserDisplayName(user_id, display_name); | 341 ChromeUserManager::SaveUserDisplayName(user_id, display_name); |
| 342 | 342 |
| 343 // Do not update local state if data stored or cached outside the user's | 343 // Do not update local state if data stored or cached outside the user's |
| 344 // cryptohome is to be treated as ephemeral. | 344 // cryptohome is to be treated as ephemeral. |
| 345 if (!IsUserNonCryptohomeDataEphemeral(user_id)) | 345 if (!IsUserNonCryptohomeDataEphemeral(user_id)) |
| 346 supervised_user_manager_->UpdateManagerName(user_id, display_name); | 346 supervised_user_manager_->UpdateManagerName(user_id, display_name); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void ChromeUserManagerImpl::StopPolicyObserverForTesting() { | 349 void ChromeUserManagerImpl::StopPolicyObserverForTesting() { |
| 350 avatar_policy_observer_.reset(); | 350 avatar_policy_observer_.reset(); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 ++it; | 617 ++it; |
| 618 } | 618 } |
| 619 } | 619 } |
| 620 } | 620 } |
| 621 | 621 |
| 622 if (changed) | 622 if (changed) |
| 623 NotifyUserListChanged(); | 623 NotifyUserListChanged(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 void ChromeUserManagerImpl::GuestUserLoggedIn() { | 626 void ChromeUserManagerImpl::GuestUserLoggedIn() { |
| 627 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 627 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 628 ChromeUserManager::GuestUserLoggedIn(); | 628 ChromeUserManager::GuestUserLoggedIn(); |
| 629 | 629 |
| 630 // TODO(nkostylev): Add support for passing guest session cryptohome | 630 // TODO(nkostylev): Add support for passing guest session cryptohome |
| 631 // mount point. Legacy (--login-profile) value will be used for now. | 631 // mount point. Legacy (--login-profile) value will be used for now. |
| 632 // http://crosbug.com/230859 | 632 // http://crosbug.com/230859 |
| 633 active_user_->SetStubImage( | 633 active_user_->SetStubImage( |
| 634 user_manager::UserImage( | 634 user_manager::UserImage( |
| 635 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 635 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 636 IDR_PROFILE_PICTURE_LOADING)), | 636 IDR_PROFILE_PICTURE_LOADING)), |
| 637 user_manager::User::USER_IMAGE_INVALID, | 637 user_manager::User::USER_IMAGE_INVALID, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 650 GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false); | 650 GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false); |
| 651 | 651 |
| 652 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); | 652 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); |
| 653 | 653 |
| 654 // Make sure that new data is persisted to Local State. | 654 // Make sure that new data is persisted to Local State. |
| 655 GetLocalState()->CommitPendingWrite(); | 655 GetLocalState()->CommitPendingWrite(); |
| 656 } | 656 } |
| 657 | 657 |
| 658 void ChromeUserManagerImpl::RegularUserLoggedInAsEphemeral( | 658 void ChromeUserManagerImpl::RegularUserLoggedInAsEphemeral( |
| 659 const std::string& user_id) { | 659 const std::string& user_id) { |
| 660 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 660 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 661 ChromeUserManager::RegularUserLoggedInAsEphemeral(user_id); | 661 ChromeUserManager::RegularUserLoggedInAsEphemeral(user_id); |
| 662 | 662 |
| 663 GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false); | 663 GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false); |
| 664 WallpaperManager::Get()->SetUserWallpaperNow(user_id); | 664 WallpaperManager::Get()->SetUserWallpaperNow(user_id); |
| 665 } | 665 } |
| 666 | 666 |
| 667 void ChromeUserManagerImpl::SupervisedUserLoggedIn(const std::string& user_id) { | 667 void ChromeUserManagerImpl::SupervisedUserLoggedIn(const std::string& user_id) { |
| 668 // TODO(nkostylev): Refactor, share code with RegularUserLoggedIn(). | 668 // TODO(nkostylev): Refactor, share code with RegularUserLoggedIn(). |
| 669 | 669 |
| 670 // Remove the user from the user list. | 670 // Remove the user from the user list. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 active_user_ = user; | 714 active_user_ = user; |
| 715 | 715 |
| 716 // The UserImageManager chooses a random avatar picture when a user logs in | 716 // The UserImageManager chooses a random avatar picture when a user logs in |
| 717 // for the first time. Tell the UserImageManager that this user is not new to | 717 // for the first time. Tell the UserImageManager that this user is not new to |
| 718 // prevent the avatar from getting changed. | 718 // prevent the avatar from getting changed. |
| 719 GetUserImageManager(user->email())->UserLoggedIn(false, true); | 719 GetUserImageManager(user->email())->UserLoggedIn(false, true); |
| 720 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); | 720 WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded(); |
| 721 } | 721 } |
| 722 | 722 |
| 723 void ChromeUserManagerImpl::KioskAppLoggedIn(const std::string& app_id) { | 723 void ChromeUserManagerImpl::KioskAppLoggedIn(const std::string& app_id) { |
| 724 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 724 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 725 policy::DeviceLocalAccount::Type device_local_account_type; | 725 policy::DeviceLocalAccount::Type device_local_account_type; |
| 726 DCHECK(policy::IsDeviceLocalAccountUser(app_id, &device_local_account_type)); | 726 DCHECK(policy::IsDeviceLocalAccountUser(app_id, &device_local_account_type)); |
| 727 DCHECK_EQ(policy::DeviceLocalAccount::TYPE_KIOSK_APP, | 727 DCHECK_EQ(policy::DeviceLocalAccount::TYPE_KIOSK_APP, |
| 728 device_local_account_type); | 728 device_local_account_type); |
| 729 | 729 |
| 730 active_user_ = user_manager::User::CreateKioskAppUser(app_id); | 730 active_user_ = user_manager::User::CreateKioskAppUser(app_id); |
| 731 active_user_->SetStubImage( | 731 active_user_->SetStubImage( |
| 732 user_manager::UserImage( | 732 user_manager::UserImage( |
| 733 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 733 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 734 IDR_PROFILE_PICTURE_LOADING)), | 734 IDR_PROFILE_PICTURE_LOADING)), |
| (...skipping 28 matching lines...) Expand all Loading... |
| 763 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 763 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 764 command_line->AppendSwitch(::switches::kForceAppMode); | 764 command_line->AppendSwitch(::switches::kForceAppMode); |
| 765 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); | 765 command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id); |
| 766 | 766 |
| 767 // Disable window animation since kiosk app runs in a single full screen | 767 // Disable window animation since kiosk app runs in a single full screen |
| 768 // window and window animation causes start-up janks. | 768 // window and window animation causes start-up janks. |
| 769 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); | 769 command_line->AppendSwitch(wm::switches::kWindowAnimationsDisabled); |
| 770 } | 770 } |
| 771 | 771 |
| 772 void ChromeUserManagerImpl::DemoAccountLoggedIn() { | 772 void ChromeUserManagerImpl::DemoAccountLoggedIn() { |
| 773 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 773 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 774 active_user_ = | 774 active_user_ = |
| 775 user_manager::User::CreateKioskAppUser(DemoAppLauncher::kDemoUserName); | 775 user_manager::User::CreateKioskAppUser(DemoAppLauncher::kDemoUserName); |
| 776 active_user_->SetStubImage( | 776 active_user_->SetStubImage( |
| 777 user_manager::UserImage( | 777 user_manager::UserImage( |
| 778 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 778 *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 779 IDR_PROFILE_PICTURE_LOADING)), | 779 IDR_PROFILE_PICTURE_LOADING)), |
| 780 user_manager::User::USER_IMAGE_INVALID, | 780 user_manager::User::USER_IMAGE_INVALID, |
| 781 false); | 781 false); |
| 782 WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); | 782 WallpaperManager::Get()->SetUserWallpaperNow(DemoAppLauncher::kDemoUserName); |
| 783 | 783 |
| 784 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 784 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 785 command_line->AppendSwitch(::switches::kForceAppMode); | 785 command_line->AppendSwitch(::switches::kForceAppMode); |
| 786 command_line->AppendSwitchASCII(::switches::kAppId, | 786 command_line->AppendSwitchASCII(::switches::kAppId, |
| 787 DemoAppLauncher::kDemoAppId); | 787 DemoAppLauncher::kDemoAppId); |
| 788 | 788 |
| 789 // Disable window animation since the demo app runs in a single full screen | 789 // Disable window animation since the demo app runs in a single full screen |
| 790 // window and window animation causes start-up janks. | 790 // window and window animation causes start-up janks. |
| 791 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 791 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 792 wm::switches::kWindowAnimationsDisabled); | 792 wm::switches::kWindowAnimationsDisabled); |
| 793 } | 793 } |
| 794 | 794 |
| 795 void ChromeUserManagerImpl::NotifyOnLogin() { | 795 void ChromeUserManagerImpl::NotifyOnLogin() { |
| 796 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 796 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 797 | 797 |
| 798 UserSessionManager::OverrideHomedir(); | 798 UserSessionManager::OverrideHomedir(); |
| 799 UpdateNumberOfUsers(); | 799 UpdateNumberOfUsers(); |
| 800 | 800 |
| 801 ChromeUserManager::NotifyOnLogin(); | 801 ChromeUserManager::NotifyOnLogin(); |
| 802 | 802 |
| 803 // TODO(nkostylev): Deprecate this notification in favor of | 803 // TODO(nkostylev): Deprecate this notification in favor of |
| 804 // ActiveUserChanged() observer call. | 804 // ActiveUserChanged() observer call. |
| 805 content::NotificationService::current()->Notify( | 805 content::NotificationService::current()->Notify( |
| 806 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 806 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 device_local_account_policy_service_->GetBrokerForUser(user_id); | 974 device_local_account_policy_service_->GetBrokerForUser(user_id); |
| 975 if (broker) | 975 if (broker) |
| 976 display_name = broker->GetDisplayName(); | 976 display_name = broker->GetDisplayName(); |
| 977 } | 977 } |
| 978 | 978 |
| 979 // Set or clear the display name. | 979 // Set or clear the display name. |
| 980 SaveUserDisplayName(user_id, base::UTF8ToUTF16(display_name)); | 980 SaveUserDisplayName(user_id, base::UTF8ToUTF16(display_name)); |
| 981 } | 981 } |
| 982 | 982 |
| 983 UserFlow* ChromeUserManagerImpl::GetCurrentUserFlow() const { | 983 UserFlow* ChromeUserManagerImpl::GetCurrentUserFlow() const { |
| 984 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 984 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 985 if (!IsUserLoggedIn()) | 985 if (!IsUserLoggedIn()) |
| 986 return GetDefaultUserFlow(); | 986 return GetDefaultUserFlow(); |
| 987 return GetUserFlow(GetLoggedInUser()->email()); | 987 return GetUserFlow(GetLoggedInUser()->email()); |
| 988 } | 988 } |
| 989 | 989 |
| 990 UserFlow* ChromeUserManagerImpl::GetUserFlow(const std::string& user_id) const { | 990 UserFlow* ChromeUserManagerImpl::GetUserFlow(const std::string& user_id) const { |
| 991 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 991 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 992 FlowMap::const_iterator it = specific_flows_.find(user_id); | 992 FlowMap::const_iterator it = specific_flows_.find(user_id); |
| 993 if (it != specific_flows_.end()) | 993 if (it != specific_flows_.end()) |
| 994 return it->second; | 994 return it->second; |
| 995 return GetDefaultUserFlow(); | 995 return GetDefaultUserFlow(); |
| 996 } | 996 } |
| 997 | 997 |
| 998 void ChromeUserManagerImpl::SetUserFlow(const std::string& user_id, | 998 void ChromeUserManagerImpl::SetUserFlow(const std::string& user_id, |
| 999 UserFlow* flow) { | 999 UserFlow* flow) { |
| 1000 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1000 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1001 ResetUserFlow(user_id); | 1001 ResetUserFlow(user_id); |
| 1002 specific_flows_[user_id] = flow; | 1002 specific_flows_[user_id] = flow; |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 void ChromeUserManagerImpl::ResetUserFlow(const std::string& user_id) { | 1005 void ChromeUserManagerImpl::ResetUserFlow(const std::string& user_id) { |
| 1006 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1006 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1007 FlowMap::iterator it = specific_flows_.find(user_id); | 1007 FlowMap::iterator it = specific_flows_.find(user_id); |
| 1008 if (it != specific_flows_.end()) { | 1008 if (it != specific_flows_.end()) { |
| 1009 delete it->second; | 1009 delete it->second; |
| 1010 specific_flows_.erase(it); | 1010 specific_flows_.erase(it); |
| 1011 } | 1011 } |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 bool ChromeUserManagerImpl::AreSupervisedUsersAllowed() const { | 1014 bool ChromeUserManagerImpl::AreSupervisedUsersAllowed() const { |
| 1015 bool supervised_users_allowed = false; | 1015 bool supervised_users_allowed = false; |
| 1016 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled, | 1016 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled, |
| 1017 &supervised_users_allowed); | 1017 &supervised_users_allowed); |
| 1018 return supervised_users_allowed; | 1018 return supervised_users_allowed; |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 UserFlow* ChromeUserManagerImpl::GetDefaultUserFlow() const { | 1021 UserFlow* ChromeUserManagerImpl::GetDefaultUserFlow() const { |
| 1022 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1022 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1023 if (!default_flow_.get()) | 1023 if (!default_flow_.get()) |
| 1024 default_flow_.reset(new DefaultUserFlow()); | 1024 default_flow_.reset(new DefaultUserFlow()); |
| 1025 return default_flow_.get(); | 1025 return default_flow_.get(); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 void ChromeUserManagerImpl::NotifyUserListChanged() { | 1028 void ChromeUserManagerImpl::NotifyUserListChanged() { |
| 1029 content::NotificationService::current()->Notify( | 1029 content::NotificationService::current()->Notify( |
| 1030 chrome::NOTIFICATION_USER_LIST_CHANGED, | 1030 chrome::NOTIFICATION_USER_LIST_CHANGED, |
| 1031 content::Source<UserManager>(this), | 1031 content::Source<UserManager>(this), |
| 1032 content::NotificationService::NoDetails()); | 1032 content::NotificationService::NoDetails()); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 | 1101 |
| 1102 if (profile->GetPrefs()->GetBoolean(prefs::kResolveTimezoneByGeolocation) && | 1102 if (profile->GetPrefs()->GetBoolean(prefs::kResolveTimezoneByGeolocation) && |
| 1103 !system::HasSystemTimezonePolicy()) { | 1103 !system::HasSystemTimezonePolicy()) { |
| 1104 g_browser_process->platform_part()->GetTimezoneResolver()->Start(); | 1104 g_browser_process->platform_part()->GetTimezoneResolver()->Start(); |
| 1105 } else { | 1105 } else { |
| 1106 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); | 1106 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); |
| 1107 } | 1107 } |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 } // namespace chromeos | 1110 } // namespace chromeos |
| OLD | NEW |