| 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_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 5 #ifndef REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| 6 #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 6 #define REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void ProcessHello(std::unique_ptr<base::DictionaryValue> message, | 65 void ProcessHello(std::unique_ptr<base::DictionaryValue> message, |
| 66 std::unique_ptr<base::DictionaryValue> response) const; | 66 std::unique_ptr<base::DictionaryValue> response) const; |
| 67 void ProcessConnect(std::unique_ptr<base::DictionaryValue> message, | 67 void ProcessConnect(std::unique_ptr<base::DictionaryValue> message, |
| 68 std::unique_ptr<base::DictionaryValue> response); | 68 std::unique_ptr<base::DictionaryValue> response); |
| 69 void ProcessDisconnect(std::unique_ptr<base::DictionaryValue> message, | 69 void ProcessDisconnect(std::unique_ptr<base::DictionaryValue> message, |
| 70 std::unique_ptr<base::DictionaryValue> response); | 70 std::unique_ptr<base::DictionaryValue> response); |
| 71 void ProcessIncomingIq(std::unique_ptr<base::DictionaryValue> message, | 71 void ProcessIncomingIq(std::unique_ptr<base::DictionaryValue> message, |
| 72 std::unique_ptr<base::DictionaryValue> response); | 72 std::unique_ptr<base::DictionaryValue> response); |
| 73 void SendErrorAndExit(std::unique_ptr<base::DictionaryValue> response, | 73 void SendErrorAndExit(std::unique_ptr<base::DictionaryValue> response, |
| 74 const std::string& description) const; | 74 const std::string& description) const; |
| 75 void SendPolicyErrorAndExit() const; |
| 75 void SendMessageToClient(std::unique_ptr<base::Value> message) const; | 76 void SendMessageToClient(std::unique_ptr<base::Value> message) const; |
| 76 | 77 |
| 77 // Callback for DelegatingSignalStrategy. | 78 // Callback for DelegatingSignalStrategy. |
| 78 void SendOutgoingIq(const std::string& iq); | 79 void SendOutgoingIq(const std::string& iq); |
| 79 | 80 |
| 80 // Called when initial policies are read and when they change. | 81 // Called when initial policies are read and when they change. |
| 81 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); | 82 void OnPolicyUpdate(std::unique_ptr<base::DictionaryValue> policies); |
| 82 | 83 |
| 84 // Called when malformed policies are detected. |
| 85 void OnPolicyError(); |
| 86 |
| 83 // Returns whether the request was successfully sent to the elevated host. | 87 // Returns whether the request was successfully sent to the elevated host. |
| 84 bool DelegateToElevatedHost(std::unique_ptr<base::DictionaryValue> message); | 88 bool DelegateToElevatedHost(std::unique_ptr<base::DictionaryValue> message); |
| 85 | 89 |
| 86 // Used to determine whether to create and pass messages to an elevated host. | 90 // Used to determine whether to create and pass messages to an elevated host. |
| 87 bool needs_elevation_ = false; | 91 bool needs_elevation_ = false; |
| 88 | 92 |
| 89 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 90 // Controls the lifetime of the elevated native messaging host process. | 94 // Controls the lifetime of the elevated native messaging host process. |
| 91 // Note: 'elevated' in this instance means having the UiAccess privilege, not | 95 // Note: 'elevated' in this instance means having the UiAccess privilege, not |
| 92 // being run as a higher privilege user. | 96 // being run as a higher privilege user. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 131 |
| 128 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; | 132 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; |
| 129 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; | 133 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; |
| 130 | 134 |
| 131 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); | 135 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); |
| 132 }; | 136 }; |
| 133 | 137 |
| 134 } // namespace remoting | 138 } // namespace remoting |
| 135 | 139 |
| 136 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 140 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
| OLD | NEW |