| 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 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 12 #include "base/memory/scoped_vector.h" | |
| 13 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
| 14 #include "chromeos/cryptohome/cryptohome_parameters.h" | 14 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 15 #include "chromeos/dbus/cryptohome_client.h" | 15 #include "chromeos/dbus/cryptohome_client.h" |
| 16 #include "third_party/cros_system_api/dbus/service_constants.h" | 16 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 17 | 17 |
| 18 namespace cryptohome { | 18 namespace cryptohome { |
| 19 | 19 |
| 20 // This class manages calls to Cryptohome service's home directory methods: | 20 // This class manages calls to Cryptohome service's home directory methods: |
| 21 // Mount, CheckKey, Add/UpdateKey. | 21 // Mount, CheckKey, Add/UpdateKey. |
| 22 class CHROMEOS_EXPORT HomedirMethods { | 22 class CHROMEOS_EXPORT HomedirMethods { |
| 23 public: | 23 public: |
| 24 // Callbacks that are called back on the UI thread when the results of the | 24 // Callbacks that are called back on the UI thread when the results of the |
| 25 // respective method calls are ready. | 25 // respective method calls are ready. |
| 26 typedef base::Callback<void(bool success, MountError return_code)> Callback; | 26 typedef base::Callback<void(bool success, MountError return_code)> Callback; |
| 27 typedef base::Callback<void( | 27 typedef base::Callback<void( |
| 28 bool success, | 28 bool success, |
| 29 MountError return_code, | 29 MountError return_code, |
| 30 ScopedVector<RetrievedKeyData> key_data)> GetKeyDataCallback; | 30 const std::vector<KeyDefinition>& key_definitions)> GetKeyDataCallback; |
| 31 typedef base::Callback< | 31 typedef base::Callback< |
| 32 void(bool success, MountError return_code, const std::string& mount_hash)> | 32 void(bool success, MountError return_code, const std::string& mount_hash)> |
| 33 MountCallback; | 33 MountCallback; |
| 34 | 34 |
| 35 virtual ~HomedirMethods() {} | 35 virtual ~HomedirMethods() {} |
| 36 | 36 |
| 37 // Asks cryptohomed to return data about the key identified by |label| for the | 37 // Asks cryptohomed to return data about the key identified by |label| for the |
| 38 // user identified by |id|. At present, this does not return any secret | 38 // user identified by |id|. At present, this does not return any secret |
| 39 // information and the request does not need to be authenticated. | 39 // information and the request does not need to be authenticated. |
| 40 virtual void GetKeyDataEx(const Identification& id, | 40 virtual void GetKeyDataEx(const Identification& id, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 static void Shutdown(); | 103 static void Shutdown(); |
| 104 | 104 |
| 105 // Returns a pointer to the global HomedirMethods instance. | 105 // Returns a pointer to the global HomedirMethods instance. |
| 106 // Initialize() should already have been called. | 106 // Initialize() should already have been called. |
| 107 static HomedirMethods* GetInstance(); | 107 static HomedirMethods* GetInstance(); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace cryptohome | 110 } // namespace cryptohome |
| 111 | 111 |
| 112 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ | 112 #endif // CHROMEOS_CRYPTOHOME_HOMEDIR_METHODS_H_ |
| OLD | NEW |