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

Side by Side Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_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: add back const 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERAT ION_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERAT ION_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERAT ION_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPERAT ION_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "chromeos/login/auth/user_context.h" 11 #include "chromeos/login/auth/user_context.h"
12 #include "third_party/cros_system_api/dbus/service_constants.h" 12 #include "third_party/cros_system_api/dbus/service_constants.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 class UserContext; 16 class UserContext;
17 17
18 // A class to remove existing Easy unlock cryptohome keys starting at given 18 // A class to remove existing Easy unlock cryptohome keys starting at given
19 // index. 19 // index.
20 class EasyUnlockRemoveKeysOperation { 20 class EasyUnlockRemoveKeysOperation {
21 public: 21 public:
22 typedef base::Callback<void (bool success)> RemoveKeysCallback; 22 typedef base::Callback<void (bool success)> RemoveKeysCallback;
23 EasyUnlockRemoveKeysOperation( 23 EasyUnlockRemoveKeysOperation(const UserContext& user_context,
24 const UserContext& user_context, 24 size_t start_index,
25 size_t start_index, 25 const RemoveKeysCallback& callback);
26 const RemoveKeysCallback& callback);
27 ~EasyUnlockRemoveKeysOperation(); 26 ~EasyUnlockRemoveKeysOperation();
28 27
29 void Start(); 28 void Start();
30 29
31 private: 30 private:
32 void OnGetSystemSalt(const std::string& system_salt); 31 void OnGetSystemSalt(const std::string& system_salt);
33 32
34 void RemoveKey(); 33 void RemoveKey();
35 void OnKeyRemoved(bool success, cryptohome::MountError return_code); 34 void OnKeyRemoved(bool success, cryptohome::MountError return_code);
36 35
37 UserContext user_context_; 36 UserContext user_context_;
38 RemoveKeysCallback callback_; 37 RemoveKeysCallback callback_;
39 size_t key_index_; 38 size_t key_index_;
40 base::WeakPtrFactory<EasyUnlockRemoveKeysOperation> weak_ptr_factory_; 39 base::WeakPtrFactory<EasyUnlockRemoveKeysOperation> weak_ptr_factory_;
41 40
42 DISALLOW_COPY_AND_ASSIGN(EasyUnlockRemoveKeysOperation); 41 DISALLOW_COPY_AND_ASSIGN(EasyUnlockRemoveKeysOperation);
43 }; 42 };
44 43
45 } // namespace chromeos 44 } // namespace chromeos
46 45
47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPE RATION_H_ 46 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_REMOVE_KEYS_OPE RATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698