Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h

Issue 808563004: Clean up Smart Lock cryptohome keys logic: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 public: 23 public:
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 EasyUnlockDeviceKeyDataList& devices, 27 const EasyUnlockDeviceKeyDataList& devices,
28 const CreateKeysCallback& callback); 28 const CreateKeysCallback& callback);
29 ~EasyUnlockCreateKeysOperation(); 29 ~EasyUnlockCreateKeysOperation();
30 30
31 void Start(); 31 void Start();
32 32
33 const UserContext& user_context() const { return user_context_; }
34
35 private: 33 private:
36 class ChallengeCreator; 34 class ChallengeCreator;
37 35
38 void CreateKeyForDeviceAtIndex(size_t index); 36 void CreateKeyForDeviceAtIndex(size_t index);
39 void OnChallengeCreated(size_t index, bool success); 37 void OnChallengeCreated(size_t index, bool success);
40 void OnGetSystemSalt(size_t index, 38 void OnGetSystemSalt(size_t index,
41 const std::string& system_salt); 39 const std::string& system_salt);
42 void OnKeyCreated(size_t index, 40 void OnKeyCreated(size_t index,
43 const Key& user_key, 41 const Key& user_key,
44 bool success, 42 bool success,
45 cryptohome::MountError return_code); 43 cryptohome::MountError return_code);
46 44
47 UserContext user_context_; 45 UserContext user_context_;
48 EasyUnlockDeviceKeyDataList devices_; 46 EasyUnlockDeviceKeyDataList devices_;
49 CreateKeysCallback callback_; 47 CreateKeysCallback callback_;
50 48
51 // Index of the key to be created. 49 // Index of the key to be created.
52 size_t key_creation_index_; 50 size_t key_creation_index_;
53 51
54 scoped_ptr<ChallengeCreator> challenge_creator_; 52 scoped_ptr<ChallengeCreator> challenge_creator_;
55 53
56 base::WeakPtrFactory<EasyUnlockCreateKeysOperation> weak_ptr_factory_; 54 base::WeakPtrFactory<EasyUnlockCreateKeysOperation> weak_ptr_factory_;
57 55
58 DISALLOW_COPY_AND_ASSIGN(EasyUnlockCreateKeysOperation); 56 DISALLOW_COPY_AND_ASSIGN(EasyUnlockCreateKeysOperation);
59 }; 57 };
60 58
61 } // namespace chromeos 59 } // namespace chromeos
62 60
63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPE RATION_H_ 61 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPE RATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698