blob: c8cb449128c41691fdcdd8a1ecc16fdf9c20b0d3 [file] [log] [blame]
[email protected]b1ae9012013-06-23 14:10:301// 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
thestiga0e18cd2015-09-25 04:58:365#ifndef REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_
6#define REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_
[email protected]b1ae9012013-06-23 14:10:307
8#include "remoting/protocol/pairing_registry.h"
9
10#include "base/files/file_path.h"
thestiga0e18cd2015-09-25 04:58:3611#include "base/gtest_prod_util.h"
[email protected]b1ae9012013-06-23 14:10:3012
13namespace base {
14class ListValue;
[email protected]b1ae9012013-06-23 14:10:3015} // namespace base
16
17namespace remoting {
18
19class PairingRegistryDelegateLinux
20 : public protocol::PairingRegistry::Delegate {
21 public:
[email protected]378466032013-08-02 01:35:1622 PairingRegistryDelegateLinux();
Peter Boströme9178e42021-09-22 18:11:4923
24 PairingRegistryDelegateLinux(const PairingRegistryDelegateLinux&) = delete;
25 PairingRegistryDelegateLinux& operator=(const PairingRegistryDelegateLinux&) =
26 delete;
27
dcheng440d8e1c2014-10-28 01:23:1528 ~PairingRegistryDelegateLinux() override;
[email protected]b1ae9012013-06-23 14:10:3029
30 // PairingRegistry::Delegate interface
dcheng0765c492016-04-06 22:41:5331 std::unique_ptr<base::ListValue> LoadAll() override;
dcheng440d8e1c2014-10-28 01:23:1532 bool DeleteAll() override;
33 protocol::PairingRegistry::Pairing Load(
mostynb11d989c2014-10-08 16:58:0934 const std::string& client_id) override;
dcheng440d8e1c2014-10-28 01:23:1535 bool Save(const protocol::PairingRegistry::Pairing& pairing) override;
36 bool Delete(const std::string& client_id) override;
[email protected]b1ae9012013-06-23 14:10:3037
38 private:
39 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, SaveAndLoad);
[email protected]378466032013-08-02 01:35:1640 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, Stateless);
[email protected]b1ae9012013-06-23 14:10:3041
[email protected]378466032013-08-02 01:35:1642 // Return the path to the directory to use for loading and saving paired
43 // clients.
44 base::FilePath GetRegistryPath();
[email protected]b1ae9012013-06-23 14:10:3045
[email protected]378466032013-08-02 01:35:1646 // For testing purposes, set the path returned by |GetRegistryPath()|.
47 void SetRegistryPathForTesting(const base::FilePath& registry_path);
[email protected]b1ae9012013-06-23 14:10:3048
[email protected]378466032013-08-02 01:35:1649 base::FilePath registry_path_for_testing_;
[email protected]b1ae9012013-06-23 14:10:3050};
51
52} // namespace remoting
53
thestiga0e18cd2015-09-25 04:58:3654#endif // REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_