| 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" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 void SendTextEvent(const std::string& text); | 88 void SendTextEvent(const std::string& text); |
| 89 | 89 |
| 90 void SendClientMessage(const std::string& type, const std::string& data); | 90 void SendClientMessage(const std::string& type, const std::string& data); |
| 91 | 91 |
| 92 // Records paint time for statistics logging, if enabled. May be called from | 92 // Records paint time for statistics logging, if enabled. May be called from |
| 93 // any thread. | 93 // any thread. |
| 94 void RecordPaintTime(int64 paint_time_ms); | 94 void RecordPaintTime(int64 paint_time_ms); |
| 95 | 95 |
| 96 // ClientUserInterface implementation. | 96 // ClientUserInterface implementation. |
| 97 virtual void OnConnectionState( | 97 void OnConnectionState(protocol::ConnectionToHost::State state, |
| 98 protocol::ConnectionToHost::State state, | 98 protocol::ErrorCode error) override; |
| 99 protocol::ErrorCode error) override; | 99 void OnConnectionReady(bool ready) override; |
| 100 virtual void OnConnectionReady(bool ready) override; | 100 void OnRouteChanged(const std::string& channel_name, |
| 101 virtual void OnRouteChanged(const std::string& channel_name, | 101 const protocol::TransportRoute& route) override; |
| 102 const protocol::TransportRoute& route) override; | 102 void SetCapabilities(const std::string& capabilities) override; |
| 103 virtual void SetCapabilities(const std::string& capabilities) override; | 103 void SetPairingResponse(const protocol::PairingResponse& response) override; |
| 104 virtual void SetPairingResponse( | 104 void DeliverHostMessage(const protocol::ExtensionMessage& message) override; |
| 105 const protocol::PairingResponse& response) override; | 105 protocol::ClipboardStub* GetClipboardStub() override; |
| 106 virtual void DeliverHostMessage( | 106 protocol::CursorShapeStub* GetCursorShapeStub() override; |
| 107 const protocol::ExtensionMessage& message) override; | |
| 108 virtual protocol::ClipboardStub* GetClipboardStub() override; | |
| 109 virtual protocol::CursorShapeStub* GetCursorShapeStub() override; | |
| 110 | 107 |
| 111 // CursorShapeStub implementation. | 108 // CursorShapeStub implementation. |
| 112 virtual void InjectClipboardEvent( | 109 void InjectClipboardEvent(const protocol::ClipboardEvent& event) override; |
| 113 const protocol::ClipboardEvent& event) override; | |
| 114 | 110 |
| 115 // ClipboardStub implementation. | 111 // ClipboardStub implementation. |
| 116 virtual void SetCursorShape(const protocol::CursorShapeInfo& shape) override; | 112 void SetCursorShape(const protocol::CursorShapeInfo& shape) override; |
| 117 | 113 |
| 118 private: | 114 private: |
| 119 // This object is ref-counted, so it cleans itself up. | 115 // This object is ref-counted, so it cleans itself up. |
| 120 virtual ~ChromotingJniInstance(); | 116 ~ChromotingJniInstance() override; |
| 121 | 117 |
| 122 void ConnectToHostOnDisplayThread(); | 118 void ConnectToHostOnDisplayThread(); |
| 123 void ConnectToHostOnNetworkThread(); | 119 void ConnectToHostOnNetworkThread(); |
| 124 void DisconnectFromHostOnNetworkThread(); | 120 void DisconnectFromHostOnNetworkThread(); |
| 125 | 121 |
| 126 // Notifies the user interface that the user needs to enter a PIN. The | 122 // Notifies the user interface that the user needs to enter a PIN. The |
| 127 // current authentication attempt is put on hold until |callback| is invoked. | 123 // current authentication attempt is put on hold until |callback| is invoked. |
| 128 // May be called on any thread. | 124 // May be called on any thread. |
| 129 void FetchSecret(bool pairable, | 125 void FetchSecret(bool pairable, |
| 130 const protocol::SecretFetchedCallback& callback); | 126 const protocol::SecretFetchedCallback& callback); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; | 187 friend class base::RefCountedThreadSafe<ChromotingJniInstance>; |
| 192 | 188 |
| 193 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; | 189 base::WeakPtrFactory<ChromotingJniInstance> weak_factory_; |
| 194 | 190 |
| 195 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); | 191 DISALLOW_COPY_AND_ASSIGN(ChromotingJniInstance); |
| 196 }; | 192 }; |
| 197 | 193 |
| 198 } // namespace remoting | 194 } // namespace remoting |
| 199 | 195 |
| 200 #endif | 196 #endif |
| OLD | NEW |