| Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h
|
| diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..db9adb2a1fb3a33d071d96f9149678110e3ae310
|
| --- /dev/null
|
| +++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERATION_H_
|
| +#define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERATION_H_
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/macros.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h"
|
| +#include "chromeos/login/auth/user_context.h"
|
| +#include "third_party/cros_system_api/dbus/service_constants.h"
|
| +
|
| +namespace chromeos {
|
| +
|
| +class UserContext;
|
| +
|
| +// A class to create Easy unlock cryptohome keys for the given user and devices.
|
| +class EasyUnlockCreateKeysOperation {
|
| + public:
|
| + typedef base::Callback<void (bool success)> CreateKeysCallback;
|
| + EasyUnlockCreateKeysOperation(
|
| + const UserContext& user_context,
|
| + const EasyUnlockDeviceKeyDataList& devices,
|
| + const CreateKeysCallback& callback);
|
| + ~EasyUnlockCreateKeysOperation();
|
| +
|
| + void Start();
|
| +
|
| + private:
|
| + class ChallengeCreator;
|
| +
|
| + void CreateKeyForDeviceAtIndex(int index);
|
| + void OnChallengeCreated(int index, bool success);
|
| +
|
| + void OnKeyCreated(int index,
|
| + bool success,
|
| + cryptohome::MountError return_code);
|
| +
|
| + UserContext user_context_;
|
| + EasyUnlockDeviceKeyDataList devices_;
|
| + CreateKeysCallback callback_;
|
| +
|
| + // Index of the key to be created.
|
| + int key_creation_index_;
|
| +
|
| + scoped_ptr<ChallengeCreator> challenge_creator_;
|
| +
|
| + base::WeakPtrFactory<EasyUnlockCreateKeysOperation> weak_ptr_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(EasyUnlockCreateKeysOperation);
|
| +};
|
| +
|
| +} // namespace chromeos
|
| +
|
| +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_CREATE_KEYS_OPERATION_H_
|
|
|