| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const Identification& id_to, | 100 const Identification& id_to, |
| 101 const Callback& callback) = 0; | 101 const Callback& callback) = 0; |
| 102 | 102 |
| 103 // Asks cryptohomed to compute the size of cryptohome for user identified by | 103 // Asks cryptohomed to compute the size of cryptohome for user identified by |
| 104 // |id|. | 104 // |id|. |
| 105 virtual void GetAccountDiskUsage( | 105 virtual void GetAccountDiskUsage( |
| 106 const Identification& id, | 106 const Identification& id, |
| 107 const GetAccountDiskUsageCallback& callback) = 0; | 107 const GetAccountDiskUsageCallback& callback) = 0; |
| 108 | 108 |
| 109 // Asks cryptohomed to migrate the cryptohome to the new encryption method | 109 // Asks cryptohomed to migrate the cryptohome to the new encryption method |
| 110 // for the user specified by |id|, using |auth| to unlock the key. | 110 // for the user specified by |id|. |
| 111 virtual void MigrateToDircrypto(const Identification& id, | 111 virtual void MigrateToDircrypto(const Identification& id, |
| 112 const Authorization& auth, | |
| 113 const DBusResultCallback& callback) = 0; | 112 const DBusResultCallback& callback) = 0; |
| 114 | 113 |
| 115 // Creates the global HomedirMethods instance. | 114 // Creates the global HomedirMethods instance. |
| 116 static void Initialize(); | 115 static void Initialize(); |
| 117 | 116 |
| 118 // Similar to Initialize(), but can inject an alternative | 117 // Similar to Initialize(), but can inject an alternative |
| 119 // HomedirMethods such as MockHomedirMethods for testing. | 118 // HomedirMethods such as MockHomedirMethods for testing. |
| 120 // The injected object will be owned by the internal pointer and deleted | 119 // The injected object will be owned by the internal pointer and deleted |
| 121 // by Shutdown(). | 120 // by Shutdown(). |
| 122 static void InitializeForTesting(HomedirMethods* homedir_methods); | 121 static void InitializeForTesting(HomedirMethods* homedir_methods); |
| 123 | 122 |
| 124 // Destroys the global HomedirMethods instance if it exists. | 123 // Destroys the global HomedirMethods instance if it exists. |
| 125 static void Shutdown(); | 124 static void Shutdown(); |
| 126 | 125 |
| 127 // Returns a pointer to the global HomedirMethods instance. | 126 // Returns a pointer to the global HomedirMethods instance. |
| 128 // Initialize() should already have been called. | 127 // Initialize() should already have been called. |
| 129 static HomedirMethods* GetInstance(); | 128 static HomedirMethods* GetInstance(); |
| 130 }; | 129 }; |
| 131 | 130 |
| 132 } // namespace cryptohome | 131 } // namespace cryptohome |
| 133 | 132 |
| 134 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ | 133 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ |
| OLD | NEW |