pairing_registry_delegate_linux.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2013 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. #ifndef REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_
  5. #define REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_
  6. #include "remoting/protocol/pairing_registry.h"
  7. #include "base/files/file_path.h"
  8. #include "base/gtest_prod_util.h"
  9. namespace remoting {
  10. class PairingRegistryDelegateLinux
  11. : public protocol::PairingRegistry::Delegate {
  12. public:
  13. PairingRegistryDelegateLinux();
  14. PairingRegistryDelegateLinux(const PairingRegistryDelegateLinux&) = delete;
  15. PairingRegistryDelegateLinux& operator=(const PairingRegistryDelegateLinux&) =
  16. delete;
  17. ~PairingRegistryDelegateLinux() override;
  18. // PairingRegistry::Delegate interface
  19. base::Value::List LoadAll() override;
  20. bool DeleteAll() override;
  21. protocol::PairingRegistry::Pairing Load(
  22. const std::string& client_id) override;
  23. bool Save(const protocol::PairingRegistry::Pairing& pairing) override;
  24. bool Delete(const std::string& client_id) override;
  25. private:
  26. FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, SaveAndLoad);
  27. FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, Stateless);
  28. // Return the path to the directory to use for loading and saving paired
  29. // clients.
  30. base::FilePath GetRegistryPath();
  31. // For testing purposes, set the path returned by |GetRegistryPath()|.
  32. void SetRegistryPathForTesting(const base::FilePath& registry_path);
  33. base::FilePath registry_path_for_testing_;
  34. };
  35. } // namespace remoting
  36. #endif // REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_