| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/policy/dm_token_storage.h" | 5 #include "chrome/browser/chromeos/policy/dm_token_storage.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | |
| 9 #include "chrome/browser/chromeos/settings/token_encryptor.h" | 8 #include "chrome/browser/chromeos/settings/token_encryptor.h" |
| 10 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 11 #include "chromeos/cryptohome/system_salt_getter.h" | 10 #include "chromeos/cryptohome/system_salt_getter.h" |
| 12 #include "components/prefs/pref_registry_simple.h" | 11 #include "components/prefs/pref_registry_simple.h" |
| 13 #include "components/prefs/pref_service.h" | 12 #include "components/prefs/pref_service.h" |
| 14 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 | 16 |
| 18 std::string EncryptToken(const std::string& system_salt, | 17 std::string EncryptToken(const std::string& system_salt, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 return; | 175 return; |
| 177 if (dm_token.empty()) | 176 if (dm_token.empty()) |
| 178 DLOG(ERROR) << "Failed to retrieve DM token."; | 177 DLOG(ERROR) << "Failed to retrieve DM token."; |
| 179 std::vector<RetrieveCallback> callbacks; | 178 std::vector<RetrieveCallback> callbacks; |
| 180 callbacks.swap(retrieve_callbacks_); | 179 callbacks.swap(retrieve_callbacks_); |
| 181 for (RetrieveCallback& callback : callbacks) | 180 for (RetrieveCallback& callback : callbacks) |
| 182 std::move(callback).Run(dm_token); | 181 std::move(callback).Run(dm_token); |
| 183 } | 182 } |
| 184 | 183 |
| 185 } // namespace policy | 184 } // namespace policy |
| OLD | NEW |