Chromium Code Reviews| Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h |
| diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bab70c17375d922b42292bde6644aa6d1d6efbc9 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h |
| @@ -0,0 +1,55 @@ |
| +// 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_REFRESH_KEYS_OPERATION_H_ |
| +#define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERATION_H_ |
| + |
| +#include <string> |
| + |
| +#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" |
| + |
| +namespace chromeos { |
| + |
| +class EasyUnlockCreateKeysOperation; |
| +class EasyUnlockRemoveKeysOperation; |
| +class UserContext; |
| + |
| +// The refresh keys operation replaces the existing keys in cryptohome with a |
| +// new list of keys. This operation is a simple combination of the remove and |
|
tbarzic
2014/12/18 10:49:05
nit: create and remove keys operation (to better m
Tim Song
2014/12/18 22:42:54
Done.
|
| +// create keys operations. |
| +class EasyUnlockRefreshKeysOperation { |
| + public: |
| + typedef base::Callback<void(bool success)> RefreshKeysCallback; |
| + EasyUnlockRefreshKeysOperation(const UserContext& user_context, |
| + const std::string& tpm_public_key, |
| + const EasyUnlockDeviceKeyDataList& devices, |
| + const RefreshKeysCallback& callback); |
| + ~EasyUnlockRefreshKeysOperation(); |
| + |
| + void Start(); |
| + |
| + private: |
| + void OnKeysCreated(bool success); |
| + void OnKeysRemoved(bool success); |
| + |
| + UserContext user_context_; |
| + std::string tpm_public_key_; |
| + EasyUnlockDeviceKeyDataList devices_; |
| + RefreshKeysCallback callback_; |
| + |
| + scoped_ptr<EasyUnlockCreateKeysOperation> create_keys_operation_; |
| + scoped_ptr<EasyUnlockRemoveKeysOperation> remove_keys_operation_; |
| + |
| + base::WeakPtrFactory<EasyUnlockRefreshKeysOperation> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(EasyUnlockRefreshKeysOperation); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERATION_H_ |