| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 } | 969 } |
| 970 } | 970 } |
| 971 | 971 |
| 972 bool ChromeUserManagerImpl::UpdateAndCleanUpDeviceLocalAccounts( | 972 bool ChromeUserManagerImpl::UpdateAndCleanUpDeviceLocalAccounts( |
| 973 const std::vector<policy::DeviceLocalAccount>& device_local_accounts) { | 973 const std::vector<policy::DeviceLocalAccount>& device_local_accounts) { |
| 974 // Try to remove any device local account data marked as pending removal. | 974 // Try to remove any device local account data marked as pending removal. |
| 975 CleanUpDeviceLocalAccountNonCryptohomeDataPendingRemoval(); | 975 CleanUpDeviceLocalAccountNonCryptohomeDataPendingRemoval(); |
| 976 | 976 |
| 977 // Get the current list of device local accounts. | 977 // Get the current list of device local accounts. |
| 978 std::vector<std::string> old_accounts; | 978 std::vector<std::string> old_accounts; |
| 979 for (const auto& user : users_) { | 979 for (auto* user : users_) { |
| 980 if (user->IsDeviceLocalAccount()) | 980 if (user->IsDeviceLocalAccount()) |
| 981 old_accounts.push_back(user->email()); | 981 old_accounts.push_back(user->email()); |
| 982 } | 982 } |
| 983 | 983 |
| 984 // If the list of device local accounts has not changed, return. | 984 // If the list of device local accounts has not changed, return. |
| 985 if (device_local_accounts.size() == old_accounts.size()) { | 985 if (device_local_accounts.size() == old_accounts.size()) { |
| 986 bool changed = false; | 986 bool changed = false; |
| 987 for (size_t i = 0; i < device_local_accounts.size(); ++i) { | 987 for (size_t i = 0; i < device_local_accounts.size(); ++i) { |
| 988 if (device_local_accounts[i].user_id != old_accounts[i]) { | 988 if (device_local_accounts[i].user_id != old_accounts[i]) { |
| 989 changed = true; | 989 changed = true; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 break; | 1323 break; |
| 1324 default: | 1324 default: |
| 1325 NOTREACHED(); | 1325 NOTREACHED(); |
| 1326 break; | 1326 break; |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 return user; | 1329 return user; |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 } // namespace chromeos | 1332 } // namespace chromeos |
| OLD | NEW |