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 "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" |
11 #include "extensions/browser/api/messaging/native_message_host.h" | 11 #include "extensions/browser/api/messaging/native_message_host.h" |
12 #include "remoting/base/auto_thread_task_runner.h" | 12 #include "remoting/base/auto_thread_task_runner.h" |
13 #include "remoting/host/chromoting_host_context.h" | 13 #include "remoting/host/chromoting_host_context.h" |
14 #include "remoting/host/it2me/it2me_host.h" | 14 #include "remoting/host/it2me/it2me_host.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 class Value; | 18 class Value; |
19 } // namespace base | 19 } // namespace base |
20 | 20 |
21 namespace remoting { | 21 namespace remoting { |
22 | 22 |
23 // Implementation of the native messaging host process. | 23 // Implementation of the native messaging host process. |
24 class It2MeNativeMessagingHost : public It2MeHost::Observer, | 24 class It2MeNativeMessagingHost : public It2MeHost::Observer, |
25 public extensions::NativeMessageHost { | 25 public extensions::NativeMessageHost { |
26 public: | 26 public: |
27 It2MeNativeMessagingHost( | 27 It2MeNativeMessagingHost( |
28 scoped_ptr<ChromotingHostContext> host_context, | 28 scoped_ptr<ChromotingHostContext> host_context, |
29 scoped_ptr<It2MeHostFactory> host_factory); | 29 scoped_ptr<It2MeHostFactory> host_factory); |
30 ~It2MeNativeMessagingHost(); | 30 ~It2MeNativeMessagingHost() override; |
31 | 31 |
32 // extensions::NativeMessageHost implementation. | 32 // extensions::NativeMessageHost implementation. |
33 void OnMessage(const std::string& message) override; | 33 void OnMessage(const std::string& message) override; |
34 void Start(Client* client) override; | 34 void Start(Client* client) override; |
35 scoped_refptr<base::SingleThreadTaskRunner> task_runner() | 35 scoped_refptr<base::SingleThreadTaskRunner> task_runner() |
36 const override; | 36 const override; |
37 | 37 |
38 // It2MeHost::Observer implementation. | 38 // It2MeHost::Observer implementation. |
39 void OnClientAuthenticated(const std::string& client_username) | 39 void OnClientAuthenticated(const std::string& client_username) |
40 override; | 40 override; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; | 79 base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_; |
80 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; | 80 base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); | 82 DISALLOW_COPY_AND_ASSIGN(It2MeNativeMessagingHost); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace remoting | 85 } // namespace remoting |
86 | 86 |
87 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ | 87 #endif // REMOTING_HOST_IT2ME_IT2ME_NATIVE_MESSAGING_HOST_H_ |
88 | 88 |
OLD | NEW |