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_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ | 5 #ifndef REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ |
6 #define REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ | 6 #define REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // Returns true if the request was successfully delegated to the elevated | 128 // Returns true if the request was successfully delegated to the elevated |
129 // host and false otherwise. | 129 // host and false otherwise. |
130 bool DelegateToElevatedHost(scoped_ptr<base::DictionaryValue> message); | 130 bool DelegateToElevatedHost(scoped_ptr<base::DictionaryValue> message); |
131 | 131 |
132 #if defined(OS_WIN) | 132 #if defined(OS_WIN) |
133 class ElevatedChannelEventHandler | 133 class ElevatedChannelEventHandler |
134 : public extensions::NativeMessagingChannel::EventHandler { | 134 : public extensions::NativeMessagingChannel::EventHandler { |
135 public: | 135 public: |
136 ElevatedChannelEventHandler(Me2MeNativeMessagingHost* host); | 136 ElevatedChannelEventHandler(Me2MeNativeMessagingHost* host); |
137 | 137 |
138 virtual void OnMessage(scoped_ptr<base::Value> message) override; | 138 void OnMessage(scoped_ptr<base::Value> message) override; |
139 virtual void OnDisconnect() override; | 139 void OnDisconnect() override; |
140 private: | 140 private: |
141 Me2MeNativeMessagingHost* parent_; | 141 Me2MeNativeMessagingHost* parent_; |
142 }; | 142 }; |
143 | 143 |
144 // Create and connect to an elevated host process if necessary. | 144 // Create and connect to an elevated host process if necessary. |
145 // |elevated_channel_| will contain the native messaging channel to the | 145 // |elevated_channel_| will contain the native messaging channel to the |
146 // elevated host if the function succeeds. | 146 // elevated host if the function succeeds. |
147 void Me2MeNativeMessagingHost::EnsureElevatedHostCreated(); | 147 void Me2MeNativeMessagingHost::EnsureElevatedHostCreated(); |
148 | 148 |
149 // Disconnect and shut down the elevated host. | 149 // Disconnect and shut down the elevated host. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 base::WeakPtr<Me2MeNativeMessagingHost> weak_ptr_; | 185 base::WeakPtr<Me2MeNativeMessagingHost> weak_ptr_; |
186 base::WeakPtrFactory<Me2MeNativeMessagingHost> weak_factory_; | 186 base::WeakPtrFactory<Me2MeNativeMessagingHost> weak_factory_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(Me2MeNativeMessagingHost); | 188 DISALLOW_COPY_AND_ASSIGN(Me2MeNativeMessagingHost); |
189 }; | 189 }; |
190 | 190 |
191 } // namespace remoting | 191 } // namespace remoting |
192 | 192 |
193 #endif // REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ | 193 #endif // REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_ |
OLD | NEW |