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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERAT ION_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERAT ION_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERAT ION_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERAT ION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 typedef base::Callback<void (bool success)> CreateKeysCallback; | 24 typedef base::Callback<void (bool success)> CreateKeysCallback; |
25 EasyUnlockCreateKeysOperation( | 25 EasyUnlockCreateKeysOperation( |
26 const UserContext& user_context, | 26 const UserContext& user_context, |
27 const std::string& tpm_public_key, | 27 const std::string& tpm_public_key, |
28 const EasyUnlockDeviceKeyDataList& devices, | 28 const EasyUnlockDeviceKeyDataList& devices, |
29 const CreateKeysCallback& callback); | 29 const CreateKeysCallback& callback); |
30 ~EasyUnlockCreateKeysOperation(); | 30 ~EasyUnlockCreateKeysOperation(); |
31 | 31 |
32 void Start(); | 32 void Start(); |
33 | 33 |
34 const UserContext& user_context() const { return user_context_; } | 34 // The UserContext returned will contain the new key if called after the |
35 // operation has completed successfully. | |
36 const UserContext& user_context() { return user_context_; } | |
xiyuan
2014/12/17 21:02:42
nit: Can we put back "const"?
Tim Song
2014/12/17 21:45:23
Done.
| |
35 | 37 |
36 private: | 38 private: |
37 class ChallengeCreator; | 39 class ChallengeCreator; |
38 | 40 |
39 void CreateKeyForDeviceAtIndex(size_t index); | 41 void CreateKeyForDeviceAtIndex(size_t index); |
40 void OnChallengeCreated(size_t index, bool success); | 42 void OnChallengeCreated(size_t index, bool success); |
41 void OnGetSystemSalt(size_t index, | 43 void OnGetSystemSalt(size_t index, |
42 const std::string& system_salt); | 44 const std::string& system_salt); |
43 void OnKeyCreated(size_t index, | 45 void OnKeyCreated(size_t index, |
44 const Key& user_key, | 46 const Key& user_key, |
(...skipping 11 matching lines...) Expand all Loading... | |
56 scoped_ptr<ChallengeCreator> challenge_creator_; | 58 scoped_ptr<ChallengeCreator> challenge_creator_; |
57 | 59 |
58 base::WeakPtrFactory<EasyUnlockCreateKeysOperation> weak_ptr_factory_; | 60 base::WeakPtrFactory<EasyUnlockCreateKeysOperation> weak_ptr_factory_; |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(EasyUnlockCreateKeysOperation); | 62 DISALLOW_COPY_AND_ASSIGN(EasyUnlockCreateKeysOperation); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace chromeos | 65 } // namespace chromeos |
64 | 66 |
65 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPE RATION_H_ | 67 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPE RATION_H_ |
OLD | NEW |