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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_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: refactor scoped_ptr from deque 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 side-by-side diff with in-line comments
Download patch
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..4e7ae7f31cb74a2d020b66caaa7a43c31fdb81cc
--- /dev/null
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h
@@ -0,0 +1,53 @@
+// 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
+// create keys operations.
+class EasyUnlockRefreshKeysOperation {
+ public:
+ typedef base::Callback<void(bool success)> RefreshKeysCallback;
+ EasyUnlockRefreshKeysOperation(const UserContext& user_context,
+ const EasyUnlockDeviceKeyDataList& devices,
+ const RefreshKeysCallback& callback);
+ ~EasyUnlockRefreshKeysOperation();
+
+ void Start();
+
+ private:
+ void OnKeysCreated(bool success);
+ void OnKeysRemoved(bool success);
+
+ UserContext user_context_;
+ 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_

Powered by Google App Engine
This is Rietveld 408576698