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