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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_keys_operation.h

Issue 554043003: cros: Create cryptohome keys for Easy sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix use-after-free Created 6 years, 3 months 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_remove_keys_operation.h
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_keys_operation.h b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_keys_operation.h
new file mode 100644
index 0000000000000000000000000000000000000000..5fa07f7608154ffdddc6a24992b1ddc5faefaebd
--- /dev/null
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_keys_operation.h
@@ -0,0 +1,43 @@
+// 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_REMOVE_KEYS_OPERATION_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERATION_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.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 remove all existing Easy unlock cryptohome keys.
+class EasyUnlockRemoveKeysOperation {
+ public:
+ typedef base::Callback<void (bool success)> RemoveKeysCallback;
+ EasyUnlockRemoveKeysOperation(
+ const UserContext& user_context,
+ const RemoveKeysCallback& callback);
+ ~EasyUnlockRemoveKeysOperation();
+
+ void Start();
+
+ private:
+ void RemoveKey();
+ void OnKeyRemoved(bool success, cryptohome::MountError return_code);
+
+ UserContext user_context_;
+ RemoveKeysCallback callback_;
+ int key_index_;
+ base::WeakPtrFactory<EasyUnlockRemoveKeysOperation> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(EasyUnlockRemoveKeysOperation);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERATION_H_

Powered by Google App Engine
This is Rietveld 408576698