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

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_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: update histograms.xml 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_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..f79ce92b05be104f4f05083a9fece0f8b8ea6f4d
--- /dev/null
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h
@@ -0,0 +1,58 @@
+// 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(size_t index);
+ void OnChallengeCreated(size_t index, bool success);
+ void OnGetSystemSalt(size_t index,
+ const std::string& system_salt);
+ void OnKeyCreated(size_t index,
+ bool success,
+ cryptohome::MountError return_code);
+
+ UserContext user_context_;
+ EasyUnlockDeviceKeyDataList devices_;
+ CreateKeysCallback callback_;
+
+ // Index of the key to be created.
+ size_t 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_
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698