| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ | 5 #ifndef REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ |
| 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ | 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ |
| 7 | 7 |
| 8 #include "remoting/protocol/pairing_registry.h" | 8 #include "remoting/protocol/pairing_registry.h" |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class ListValue; | 13 class ListValue; |
| 14 } // namespace base | 14 } // namespace base |
| 15 | 15 |
| 16 namespace remoting { | 16 namespace remoting { |
| 17 | 17 |
| 18 class PairingRegistryDelegateLinux | 18 class PairingRegistryDelegateLinux |
| 19 : public protocol::PairingRegistry::Delegate { | 19 : public protocol::PairingRegistry::Delegate { |
| 20 public: | 20 public: |
| 21 PairingRegistryDelegateLinux(); | 21 PairingRegistryDelegateLinux(); |
| 22 virtual ~PairingRegistryDelegateLinux(); | 22 ~PairingRegistryDelegateLinux() override; |
| 23 | 23 |
| 24 // PairingRegistry::Delegate interface | 24 // PairingRegistry::Delegate interface |
| 25 virtual scoped_ptr<base::ListValue> LoadAll() override; | 25 scoped_ptr<base::ListValue> LoadAll() override; |
| 26 virtual bool DeleteAll() override; | 26 bool DeleteAll() override; |
| 27 virtual protocol::PairingRegistry::Pairing Load( | 27 protocol::PairingRegistry::Pairing Load( |
| 28 const std::string& client_id) override; | 28 const std::string& client_id) override; |
| 29 virtual bool Save(const protocol::PairingRegistry::Pairing& pairing) override; | 29 bool Save(const protocol::PairingRegistry::Pairing& pairing) override; |
| 30 virtual bool Delete(const std::string& client_id) override; | 30 bool Delete(const std::string& client_id) override; |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, SaveAndLoad); | 33 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, SaveAndLoad); |
| 34 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, Stateless); | 34 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, Stateless); |
| 35 | 35 |
| 36 // Return the path to the directory to use for loading and saving paired | 36 // Return the path to the directory to use for loading and saving paired |
| 37 // clients. | 37 // clients. |
| 38 base::FilePath GetRegistryPath(); | 38 base::FilePath GetRegistryPath(); |
| 39 | 39 |
| 40 // For testing purposes, set the path returned by |GetRegistryPath()|. | 40 // For testing purposes, set the path returned by |GetRegistryPath()|. |
| 41 void SetRegistryPathForTesting(const base::FilePath& registry_path); | 41 void SetRegistryPathForTesting(const base::FilePath& registry_path); |
| 42 | 42 |
| 43 base::FilePath registry_path_for_testing_; | 43 base::FilePath registry_path_for_testing_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(PairingRegistryDelegateLinux); | 45 DISALLOW_COPY_AND_ASSIGN(PairingRegistryDelegateLinux); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace remoting | 48 } // namespace remoting |
| 49 | 49 |
| 50 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ | 50 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_LINUX_H_ |
| OLD | NEW |