OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERA
TION_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERA
TION_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/macros.h" | |
12 #include "base/memory/weak_ptr.h" | |
13 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" | |
14 #include "chromeos/login/auth/user_context.h" | |
15 | |
16 namespace chromeos { | |
17 | |
18 class EasyUnlockCreateKeysOperation; | |
19 class EasyUnlockRemoveKeysOperation; | |
20 class UserContext; | |
21 | |
22 // The refresh keys operation replaces the existing keys in cryptohome with a | |
23 // new list of keys. This operation is a simple sequence of the create and | |
24 // remove keys operations. | |
25 class EasyUnlockRefreshKeysOperation { | |
26 public: | |
27 typedef base::Callback<void(bool success)> RefreshKeysCallback; | |
28 EasyUnlockRefreshKeysOperation(const UserContext& user_context, | |
29 const std::string& tpm_public_key, | |
30 const EasyUnlockDeviceKeyDataList& devices, | |
31 const RefreshKeysCallback& callback); | |
32 ~EasyUnlockRefreshKeysOperation(); | |
33 | |
34 void Start(); | |
35 | |
36 private: | |
37 void OnKeysCreated(bool success); | |
38 void OnKeysRemoved(bool success); | |
39 | |
40 UserContext user_context_; | |
41 std::string tpm_public_key_; | |
42 EasyUnlockDeviceKeyDataList devices_; | |
43 RefreshKeysCallback callback_; | |
44 | |
45 scoped_ptr<EasyUnlockCreateKeysOperation> create_keys_operation_; | |
46 scoped_ptr<EasyUnlockRemoveKeysOperation> remove_keys_operation_; | |
47 | |
48 base::WeakPtrFactory<EasyUnlockRefreshKeysOperation> weak_ptr_factory_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(EasyUnlockRefreshKeysOperation); | |
51 }; | |
52 | |
53 } // namespace chromeos | |
54 | |
55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OP
ERATION_H_ | |
OLD | NEW |