| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | 5 #ifndef COMPONENTS_CRYPTAUTH_LOCAL_DEVICE_DATA_PROVIDER_H_ |
| 6 #define CHROMEOS_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | 6 #define COMPONENTS_CRYPTAUTH_LOCAL_DEVICE_DATA_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 | 14 |
| 15 namespace cryptauth { | 15 namespace cryptauth { |
| 16 |
| 16 class BeaconSeed; | 17 class BeaconSeed; |
| 17 class CryptAuthService; | 18 class CryptAuthService; |
| 18 } | |
| 19 | |
| 20 namespace chromeos { | |
| 21 | |
| 22 namespace tether { | |
| 23 | 19 |
| 24 // Fetches CryptAuth data about the local device (i.e., the device on which this | 20 // Fetches CryptAuth data about the local device (i.e., the device on which this |
| 25 // code is running) for the current user (i.e., the one which is logged-in). | 21 // code is running) for the current user (i.e., the one which is logged-in). |
| 26 class LocalDeviceDataProvider { | 22 class LocalDeviceDataProvider { |
| 27 public: | 23 public: |
| 28 explicit LocalDeviceDataProvider( | 24 explicit LocalDeviceDataProvider(CryptAuthService* cryptauth_service); |
| 29 cryptauth::CryptAuthService* cryptauth_service); | |
| 30 virtual ~LocalDeviceDataProvider(); | 25 virtual ~LocalDeviceDataProvider(); |
| 31 | 26 |
| 32 // Fetches the public key and/or the beacon seeds for the local device. | 27 // Fetches the public key and/or the beacon seeds for the local device. |
| 33 // Returns whether the operation succeeded. If |nullptr| is passed as a | 28 // Returns whether the operation succeeded. If |nullptr| is passed as a |
| 34 // parameter, the associated data will not be fetched. | 29 // parameter, the associated data will not be fetched. |
| 35 virtual bool GetLocalDeviceData( | 30 virtual bool GetLocalDeviceData( |
| 36 std::string* public_key_out, | 31 std::string* public_key_out, |
| 37 std::vector<cryptauth::BeaconSeed>* beacon_seeds_out) const; | 32 std::vector<BeaconSeed>* beacon_seeds_out) const; |
| 38 | 33 |
| 39 private: | 34 private: |
| 40 friend class LocalDeviceDataProviderTest; | 35 friend class LocalDeviceDataProviderTest; |
| 41 | 36 |
| 42 cryptauth::CryptAuthService* cryptauth_service_; | 37 CryptAuthService* cryptauth_service_; |
| 43 | 38 |
| 44 DISALLOW_COPY_AND_ASSIGN(LocalDeviceDataProvider); | 39 DISALLOW_COPY_AND_ASSIGN(LocalDeviceDataProvider); |
| 45 }; | 40 }; |
| 46 | 41 |
| 47 } // namespace tether | 42 } // namespace cryptauth |
| 48 | 43 |
| 49 } // namespace chromeos | 44 #endif // COMPONENTS_CRYPTAUTH_LOCAL_DEVICE_DATA_PROVIDER_H_ |
| 50 | |
| 51 #endif // CHROMEOS_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | |
| OLD | NEW |