Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 | 182 |
| 183 UserManagerImpl::~UserManagerImpl() { | 183 UserManagerImpl::~UserManagerImpl() { |
| 184 // Can't use STLDeleteElements because of the private destructor of User. | 184 // Can't use STLDeleteElements because of the private destructor of User. |
| 185 for (UserList::iterator it = users_.begin(); it != users_.end(); | 185 for (UserList::iterator it = users_.begin(); it != users_.end(); |
| 186 it = users_.erase(it)) { | 186 it = users_.erase(it)) { |
| 187 if (logged_in_user_ == *it) | 187 if (logged_in_user_ == *it) |
| 188 logged_in_user_ = NULL; | 188 logged_in_user_ = NULL; |
| 189 delete *it; | 189 delete *it; |
| 190 } | 190 } |
| 191 delete logged_in_user_; | 191 delete logged_in_user_; |
| 192 | |
| 193 // Use singleton UserManagerImpl to manage the lifetime of WallpaperManager. | |
| 194 delete WallpaperManager::Get(); | |
|
Joao da Silva
2013/01/22 10:04:12
This is quite strange. Why not make WallpaperManag
bshe
2013/01/22 15:36:26
Reading comment for singleton here:
http://code.go
| |
| 192 } | 195 } |
| 193 | 196 |
| 194 void UserManagerImpl::Shutdown() { | 197 void UserManagerImpl::Shutdown() { |
| 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 198 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 196 cros_settings_->RemoveSettingsObserver(kAccountsPrefDeviceLocalAccounts, | 199 cros_settings_->RemoveSettingsObserver(kAccountsPrefDeviceLocalAccounts, |
| 197 this); | 200 this); |
| 198 // Stop the session length limiter. | 201 // Stop the session length limiter. |
| 199 session_length_limiter_.reset(); | 202 session_length_limiter_.reset(); |
| 200 | 203 |
| 201 if (device_local_account_policy_service_) | 204 if (device_local_account_policy_service_) |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 device_local_account_policy_service_->GetBrokerForAccount(username); | 1014 device_local_account_policy_service_->GetBrokerForAccount(username); |
| 1012 if (broker) | 1015 if (broker) |
| 1013 display_name = broker->GetDisplayName(); | 1016 display_name = broker->GetDisplayName(); |
| 1014 } | 1017 } |
| 1015 | 1018 |
| 1016 // Set or clear the display name. | 1019 // Set or clear the display name. |
| 1017 SaveUserDisplayName(username, UTF8ToUTF16(display_name)); | 1020 SaveUserDisplayName(username, UTF8ToUTF16(display_name)); |
| 1018 } | 1021 } |
| 1019 | 1022 |
| 1020 } // namespace chromeos | 1023 } // namespace chromeos |
| OLD | NEW |