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_CLIENT_CHROMOTING_JNI_INSTANCE_H_ | 5 #ifndef REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ | 6 #define REMOTING_CLIENT_CHROMOTING_JNI_INSTANCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "remoting/client/chromoting_client.h" | 14 #include "remoting/client/chromoting_client.h" |
15 #include "remoting/client/client_config.h" | |
16 #include "remoting/client/client_context.h" | 15 #include "remoting/client/client_context.h" |
17 #include "remoting/client/client_user_interface.h" | 16 #include "remoting/client/client_user_interface.h" |
18 #include "remoting/client/frame_consumer_proxy.h" | 17 #include "remoting/client/frame_consumer_proxy.h" |
19 #include "remoting/client/jni/jni_frame_consumer.h" | 18 #include "remoting/client/jni/jni_frame_consumer.h" |
20 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 19 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
21 #include "remoting/protocol/clipboard_stub.h" | 20 #include "remoting/protocol/clipboard_stub.h" |
22 #include "remoting/protocol/connection_to_host.h" | |
23 #include "remoting/protocol/cursor_shape_stub.h" | 21 #include "remoting/protocol/cursor_shape_stub.h" |
24 | 22 |
25 namespace remoting { | 23 namespace remoting { |
26 | 24 |
27 namespace protocol { | 25 namespace protocol { |
28 class ClipboardEvent; | 26 class ClipboardEvent; |
29 class CursorShapeInfo; | 27 class CursorShapeInfo; |
30 } // namespace protocol | 28 } // namespace protocol |
31 | 29 |
32 class ClientStatusLogger; | 30 class ClientStatusLogger; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual void OnConnectionReady(bool ready) OVERRIDE; | 97 virtual void OnConnectionReady(bool ready) OVERRIDE; |
100 virtual void OnRouteChanged(const std::string& channel_name, | 98 virtual void OnRouteChanged(const std::string& channel_name, |
101 const protocol::TransportRoute& route) OVERRIDE; | 99 const protocol::TransportRoute& route) OVERRIDE; |
102 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; | 100 virtual void SetCapabilities(const std::string& capabilities) OVERRIDE; |
103 virtual void SetPairingResponse( | 101 virtual void SetPairingResponse( |
104 const protocol::PairingResponse& response) OVERRIDE; | 102 const protocol::PairingResponse& response) OVERRIDE; |
105 virtual void DeliverHostMessage( | 103 virtual void DeliverHostMessage( |
106 const protocol::ExtensionMessage& message) OVERRIDE; | 104 const protocol::ExtensionMessage& message) OVERRIDE; |
107 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; | 105 virtual protocol::ClipboardStub* GetClipboardStub() OVERRIDE; |
108 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; | 106 virtual protocol::CursorShapeStub* GetCursorShapeStub() OVERRIDE; |
109 virtual scoped_ptr<protocol::ThirdPartyClientAuthenticator::TokenFetcher> | |
110 GetTokenFetcher(const std::string& host_public_key) OVERRIDE; | |
111 | 107 |
112 // CursorShapeStub implementation. | 108 // CursorShapeStub implementation. |
113 virtual void InjectClipboardEvent( | 109 virtual void InjectClipboardEvent( |
114 const protocol::ClipboardEvent& event) OVERRIDE; | 110 const protocol::ClipboardEvent& event) OVERRIDE; |
115 | 111 |
116 // ClipboardStub implementation. | 112 // ClipboardStub implementation. |
117 virtual void SetCursorShape(const protocol::CursorShapeInfo& shape) OVERRIDE; | 113 virtual void SetCursorShape(const protocol::CursorShapeInfo& shape) OVERRIDE; |
118 | 114 |
119 private: | 115 private: |
120 // This object is ref-counted, so it cleans itself up. | 116 // This object is ref-counted, so it cleans itself up. |
(...skipping 21 matching lines...) Expand all Loading... |
142 // If logging is enabled, logs the current connection statistics, and | 138 // If logging is enabled, logs the current connection statistics, and |
143 // triggers another call to this function after the logging time interval. | 139 // triggers another call to this function after the logging time interval. |
144 // Called on the network thread. | 140 // Called on the network thread. |
145 void LogPerfStats(); | 141 void LogPerfStats(); |
146 | 142 |
147 // Used to obtain task runner references and make calls to Java methods. | 143 // Used to obtain task runner references and make calls to Java methods. |
148 ChromotingJniRuntime* jni_runtime_; | 144 ChromotingJniRuntime* jni_runtime_; |
149 | 145 |
150 // ID of the host we are connecting to. | 146 // ID of the host we are connecting to. |
151 std::string host_id_; | 147 std::string host_id_; |
| 148 std::string host_jid_; |
152 | 149 |
153 // This group of variables is to be used on the display thread. | 150 // This group of variables is to be used on the display thread. |
154 scoped_refptr<FrameConsumerProxy> frame_consumer_; | 151 scoped_refptr<FrameConsumerProxy> frame_consumer_; |
155 scoped_ptr<JniFrameConsumer> view_; | 152 scoped_ptr<JniFrameConsumer> view_; |
156 scoped_ptr<base::WeakPtrFactory<JniFrameConsumer> > view_weak_factory_; | 153 scoped_ptr<base::WeakPtrFactory<JniFrameConsumer> > view_weak_factory_; |
157 | 154 |
158 // This group of variables is to be used on the network thread. | 155 // This group of variables is to be used on the network thread. |
159 ClientConfig client_config_; | |
160 scoped_ptr<ClientContext> client_context_; | 156 scoped_ptr<ClientContext> client_context_; |
161 scoped_ptr<VideoRenderer> video_renderer_; | 157 scoped_ptr<VideoRenderer> video_renderer_; |
162 scoped_ptr<protocol::ConnectionToHost> connection_; | 158 scoped_ptr<protocol::Authenticator> authenticator_; |
163 scoped_ptr<ChromotingClient> client_; | 159 scoped_ptr<ChromotingClient> client_; |
164 XmppSignalStrategy::XmppServerConfig xmpp_config_; | 160 XmppSignalStrategy::XmppServerConfig xmpp_config_; |
165 scoped_ptr<XmppSignalStrategy> signaling_; // Must outlive client_ | 161 scoped_ptr<XmppSignalStrategy> signaling_; // Must outlive client_ |
166 scoped_ptr<ClientStatusLogger> client_status_logger_; | 162 scoped_ptr<ClientStatusLogger> client_status_logger_; |
167 base::WeakPtr<TokenFetcherProxy> token_fetcher_proxy_; | 163 base::WeakPtr<TokenFetcherProxy> token_fetcher_proxy_; |
168 | 164 |
169 // Pass this the user's PIN once we have it. To be assigned and accessed on | 165 // Pass this the user's PIN once we have it. To be assigned and accessed on |
170 // the UI thread, but must be posted to the network thread to call it. | 166 // the UI thread, but must be posted to the network thread to call it. |
171 protocol::SecretFetchedCallback pin_callback_; | 167 protocol::SecretFetchedCallback pin_callback_; |
172 | 168 |
(...skipping 14 matching lines...) Expand all Loading... |
187 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; | 183 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; |
188 | 184 |
189 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; | 185 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; |
190 | 186 |
191 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); | 187 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); |
192 }; | 188 }; |
193 | 189 |
194 } // namespace remoting | 190 } // namespace remoting |
195 | 191 |
196 #endif | 192 #endif |
OLD | NEW |