| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | |
| 6 #define CHROMEOS_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "base/memory/ptr_util.h" | |
| 14 | |
| 15 namespace cryptauth { | |
| 16 class BeaconSeed; | |
| 17 class CryptAuthService; | |
| 18 } | |
| 19 | |
| 20 namespace chromeos { | |
| 21 | |
| 22 namespace tether { | |
| 23 | |
| 24 // 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). | |
| 26 class LocalDeviceDataProvider { | |
| 27 public: | |
| 28 explicit LocalDeviceDataProvider( | |
| 29 cryptauth::CryptAuthService* cryptauth_service); | |
| 30 virtual ~LocalDeviceDataProvider(); | |
| 31 | |
| 32 // 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 | |
| 34 // parameter, the associated data will not be fetched. | |
| 35 virtual bool GetLocalDeviceData( | |
| 36 std::string* public_key_out, | |
| 37 std::vector<cryptauth::BeaconSeed>* beacon_seeds_out) const; | |
| 38 | |
| 39 private: | |
| 40 friend class LocalDeviceDataProviderTest; | |
| 41 | |
| 42 cryptauth::CryptAuthService* cryptauth_service_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(LocalDeviceDataProvider); | |
| 45 }; | |
| 46 | |
| 47 } // namespace tether | |
| 48 | |
| 49 } // namespace chromeos | |
| 50 | |
| 51 #endif // CHROMEOS_COMPONENTS_TETHER_LOCAL_DEVICE_DATA_PROVIDER_H_ | |
| OLD | NEW |