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_GET_KEYS_OPERATION
_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_GET_KEYS_OPERATION
_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_vector.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
| 13 #include "chromeos/cryptohome/homedir_methods.h" |
| 14 #include "chromeos/login/auth/user_context.h" |
| 15 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 class EasyUnlockGetKeysOperation { |
| 20 public: |
| 21 typedef base::Callback<void(bool success, |
| 22 const EasyUnlockDeviceKeyDataList& data_list)> |
| 23 GetKeysCallback; |
| 24 EasyUnlockGetKeysOperation(const UserContext& user_context, |
| 25 const GetKeysCallback& callback); |
| 26 ~EasyUnlockGetKeysOperation(); |
| 27 |
| 28 void Start(); |
| 29 |
| 30 private: |
| 31 void GetKeyData(); |
| 32 void OnGetKeyData(bool success, |
| 33 cryptohome::MountError return_code, |
| 34 ScopedVector<cryptohome::RetrievedKeyData> retrieved_data); |
| 35 |
| 36 UserContext user_context_; |
| 37 GetKeysCallback callback_; |
| 38 |
| 39 int key_index_; |
| 40 EasyUnlockDeviceKeyDataList devices_; |
| 41 |
| 42 base::WeakPtrFactory<EasyUnlockGetKeysOperation> weak_ptr_factory_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(EasyUnlockGetKeysOperation); |
| 45 }; |
| 46 |
| 47 } // namespace chromeos |
| 48 |
| 49 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_GET_KEYS_OPERAT
ION_H_ |
OLD | NEW |