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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERA TION_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OPERA TION_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h"
13 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h"
14 #include "chromeos/login/auth/user_context.h"
15
16 namespace chromeos {
17
18 class EasyUnlockCreateKeysOperation;
19 class EasyUnlockRemoveKeysOperation;
20 class UserContext;
21
22 // The refresh keys operation replaces the existing keys in cryptohome with a
23 // new list of keys. This operation is a simple combination of the remove and
24 // create keys operations.
25 class EasyUnlockRefreshKeysOperation {
26 public:
27 typedef base::Callback<void(bool success)> RefreshKeysCallback;
28 EasyUnlockRefreshKeysOperation(const UserContext& user_context,
29 const EasyUnlockDeviceKeyDataList& devices,
30 const RefreshKeysCallback& callback);
31 ~EasyUnlockRefreshKeysOperation();
32
33 void Start();
34
35 private:
36 void OnKeysCreated(bool success);
37 void OnKeysRemoved(bool success);
38
39 UserContext user_context_;
40 EasyUnlockDeviceKeyDataList devices_;
41 RefreshKeysCallback callback_;
42
43 scoped_ptr<EasyUnlockCreateKeysOperation> create_keys_operation_;
44 scoped_ptr<EasyUnlockRemoveKeysOperation> remove_keys_operation_;
45
46 base::WeakPtrFactory<EasyUnlockRefreshKeysOperation> weak_ptr_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(EasyUnlockRefreshKeysOperation);
49 };
50
51 } // namespace chromeos
52
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REFRESH_KEYS_OP ERATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698