ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / easy_unlock / easy_unlock_get_keys_operation.h
blobde0e6670a710635cc52ef707239ad288970ca2fe
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.
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_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h"
12 #include "chromeos/cryptohome/homedir_methods.h"
13 #include "chromeos/login/auth/user_context.h"
14 #include "third_party/cros_system_api/dbus/service_constants.h"
16 namespace chromeos {
18 class EasyUnlockGetKeysOperation {
19 public:
20 typedef base::Callback<void(bool success,
21 const EasyUnlockDeviceKeyDataList& data_list)>
22 GetKeysCallback;
23 EasyUnlockGetKeysOperation(const UserContext& user_context,
24 const GetKeysCallback& callback);
25 ~EasyUnlockGetKeysOperation();
27 void Start();
29 private:
30 void GetKeyData();
31 void OnGetKeyData(
32 bool success,
33 cryptohome::MountError return_code,
34 const std::vector<cryptohome::KeyDefinition>& key_definitions);
36 UserContext user_context_;
37 GetKeysCallback callback_;
39 size_t key_index_;
40 EasyUnlockDeviceKeyDataList devices_;
42 base::WeakPtrFactory<EasyUnlockGetKeysOperation> weak_ptr_factory_;
44 DISALLOW_COPY_AND_ASSIGN(EasyUnlockGetKeysOperation);
47 } // namespace chromeos
49 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_GET_KEYS_OPERATION_H_