| 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_WIN_H_ | 5 #ifndef REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_WIN_H_ |
| 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_WIN_H_ | 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // code. | 37 // code. |
| 38 // - |unprivileged| - contains the rest of pairing state. | 38 // - |unprivileged| - contains the rest of pairing state. |
| 39 // | 39 // |
| 40 // Creator of this object is responsible for passing the registry key handles | 40 // Creator of this object is responsible for passing the registry key handles |
| 41 // with appropriate access. |privileged| may be nullptr if read-only access is | 41 // with appropriate access. |privileged| may be nullptr if read-only access is |
| 42 // sufficient. Shared secrets will not be returned in such a case. | 42 // sufficient. Shared secrets will not be returned in such a case. |
| 43 class PairingRegistryDelegateWin | 43 class PairingRegistryDelegateWin |
| 44 : public protocol::PairingRegistry::Delegate { | 44 : public protocol::PairingRegistry::Delegate { |
| 45 public: | 45 public: |
| 46 PairingRegistryDelegateWin(); | 46 PairingRegistryDelegateWin(); |
| 47 virtual ~PairingRegistryDelegateWin(); | 47 ~PairingRegistryDelegateWin() override; |
| 48 | 48 |
| 49 // Passes the root keys to be used to access the pairing registry store. | 49 // Passes the root keys to be used to access the pairing registry store. |
| 50 // |privileged| is optional and may be nullptr. The caller retains ownership | 50 // |privileged| is optional and may be nullptr. The caller retains ownership |
| 51 // of the passed handles. | 51 // of the passed handles. |
| 52 bool SetRootKeys(HKEY privileged, HKEY unprivileged); | 52 bool SetRootKeys(HKEY privileged, HKEY unprivileged); |
| 53 | 53 |
| 54 // PairingRegistry::Delegate interface | 54 // PairingRegistry::Delegate interface |
| 55 virtual scoped_ptr<base::ListValue> LoadAll() override; | 55 scoped_ptr<base::ListValue> LoadAll() override; |
| 56 virtual bool DeleteAll() override; | 56 bool DeleteAll() override; |
| 57 virtual protocol::PairingRegistry::Pairing Load( | 57 protocol::PairingRegistry::Pairing Load( |
| 58 const std::string& client_id) override; | 58 const std::string& client_id) override; |
| 59 virtual bool Save(const protocol::PairingRegistry::Pairing& pairing) override; | 59 bool Save(const protocol::PairingRegistry::Pairing& pairing) override; |
| 60 virtual bool Delete(const std::string& client_id) override; | 60 bool Delete(const std::string& client_id) override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 base::win::RegKey privileged_; | 63 base::win::RegKey privileged_; |
| 64 base::win::RegKey unprivileged_; | 64 base::win::RegKey unprivileged_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(PairingRegistryDelegateWin); | 66 DISALLOW_COPY_AND_ASSIGN(PairingRegistryDelegateWin); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace remoting | 69 } // namespace remoting |
| 70 | 70 |
| 71 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_WIN_H_ | 71 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_DELEGATE_WIN_H_ |
| OLD | NEW |