OLD | NEW |
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 CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ | 5 #ifndef CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ |
6 #define CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ | 6 #define CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const std::string& signature, | 82 const std::string& signature, |
83 const Callback& callback) = 0; | 83 const Callback& callback) = 0; |
84 | 84 |
85 // Asks cryptohomed to remove specific key labeled with |label| for user | 85 // Asks cryptohomed to remove specific key labeled with |label| for user |
86 // identified by |id| using |auth|. | 86 // identified by |id| using |auth|. |
87 virtual void RemoveKeyEx(const Identification& id, | 87 virtual void RemoveKeyEx(const Identification& id, |
88 const Authorization& auth, | 88 const Authorization& auth, |
89 const std::string& label, | 89 const std::string& label, |
90 const Callback& callback) = 0; | 90 const Callback& callback) = 0; |
91 | 91 |
| 92 // Asks cryptohomed to change cryptohome identification |id_from| to |id_to|, |
| 93 // which results in cryptohome directory renaming. |
| 94 virtual void RenameCryptohome(const Identification& id_from, |
| 95 const Identification& id_to, |
| 96 const Callback& callback) = 0; |
| 97 |
92 // Creates the global HomedirMethods instance. | 98 // Creates the global HomedirMethods instance. |
93 static void Initialize(); | 99 static void Initialize(); |
94 | 100 |
95 // Similar to Initialize(), but can inject an alternative | 101 // Similar to Initialize(), but can inject an alternative |
96 // HomedirMethods such as MockHomedirMethods for testing. | 102 // HomedirMethods such as MockHomedirMethods for testing. |
97 // The injected object will be owned by the internal pointer and deleted | 103 // The injected object will be owned by the internal pointer and deleted |
98 // by Shutdown(). | 104 // by Shutdown(). |
99 static void InitializeForTesting(HomedirMethods* homedir_methods); | 105 static void InitializeForTesting(HomedirMethods* homedir_methods); |
100 | 106 |
101 // Destroys the global HomedirMethods instance if it exists. | 107 // Destroys the global HomedirMethods instance if it exists. |
102 static void Shutdown(); | 108 static void Shutdown(); |
103 | 109 |
104 // Returns a pointer to the global HomedirMethods instance. | 110 // Returns a pointer to the global HomedirMethods instance. |
105 // Initialize() should already have been called. | 111 // Initialize() should already have been called. |
106 static HomedirMethods* GetInstance(); | 112 static HomedirMethods* GetInstance(); |
107 }; | 113 }; |
108 | 114 |
109 } // namespace cryptohome | 115 } // namespace cryptohome |
110 | 116 |
111 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ | 117 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ |
OLD | NEW |