blob: d147644c89896ad2188aff84a7e38483a81c01c6 [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"
avic5960f32015-12-22 22:49:4812#include "base/macros.h"
[email protected]b1ae9012013-06-23 14:10:3013
14namespace base {
15class ListValue;
[email protected]b1ae9012013-06-23 14:10:3016} // namespace base
17
18namespace remoting {
19
20class PairingRegistryDelegateLinux
21 : public protocol::PairingRegistry::Delegate {
22 public:
[email protected]378466032013-08-02 01:35:1623 PairingRegistryDelegateLinux();
dcheng440d8e1c2014-10-28 01:23:1524 ~PairingRegistryDelegateLinux() override;
[email protected]b1ae9012013-06-23 14:10:3025
26 // PairingRegistry::Delegate interface
dcheng0765c492016-04-06 22:41:5327 std::unique_ptr<base::ListValue> LoadAll() override;
dcheng440d8e1c2014-10-28 01:23:1528 bool DeleteAll() override;
29 protocol::PairingRegistry::Pairing Load(
mostynb11d989c2014-10-08 16:58:0930 const std::string& client_id) override;
dcheng440d8e1c2014-10-28 01:23:1531 bool Save(const protocol::PairingRegistry::Pairing& pairing) override;
32 bool Delete(const std::string& client_id) override;
[email protected]b1ae9012013-06-23 14:10:3033
34 private:
35 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, SaveAndLoad);
[email protected]378466032013-08-02 01:35:1636 FRIEND_TEST_ALL_PREFIXES(PairingRegistryDelegateLinuxTest, Stateless);
[email protected]b1ae9012013-06-23 14:10:3037
[email protected]378466032013-08-02 01:35:1638 // Return the path to the directory to use for loading and saving paired
39 // clients.
40 base::FilePath GetRegistryPath();
[email protected]b1ae9012013-06-23 14:10:3041
[email protected]378466032013-08-02 01:35:1642 // For testing purposes, set the path returned by |GetRegistryPath()|.
43 void SetRegistryPathForTesting(const base::FilePath& registry_path);
[email protected]b1ae9012013-06-23 14:10:3044
[email protected]378466032013-08-02 01:35:1645 base::FilePath registry_path_for_testing_;
[email protected]b1ae9012013-06-23 14:10:3046
47 DISALLOW_COPY_AND_ASSIGN(PairingRegistryDelegateLinux);
48};
49
50} // namespace remoting
51
thestiga0e18cd2015-09-25 04:58:3652#endif // REMOTING_HOST_PAIRING_REGISTRY_DELEGATE_LINUX_H_