| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROTOCOL_CONNECTION_TO_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // delayed. This is used to indicate in the UI when connection is | 75 // delayed. This is used to indicate in the UI when connection is |
| 76 // temporarily broken. | 76 // temporarily broken. |
| 77 virtual void OnConnectionReady(bool ready) = 0; | 77 virtual void OnConnectionReady(bool ready) = 0; |
| 78 | 78 |
| 79 // Called when the route type (direct vs. STUN vs. proxied) changes. | 79 // Called when the route type (direct vs. STUN vs. proxied) changes. |
| 80 virtual void OnRouteChanged(const std::string& channel_name, | 80 virtual void OnRouteChanged(const std::string& channel_name, |
| 81 const protocol::TransportRoute& route) = 0; | 81 const protocol::TransportRoute& route) = 0; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 ConnectionToHost(); | 84 ConnectionToHost(); |
| 85 virtual ~ConnectionToHost(); | 85 ~ConnectionToHost() override; |
| 86 | 86 |
| 87 // Allows to set a custom protocol configuration (e.g. for tests). Cannot be | 87 // Allows to set a custom protocol configuration (e.g. for tests). Cannot be |
| 88 // called after Connect(). | 88 // called after Connect(). |
| 89 void set_candidate_config(scoped_ptr<CandidateSessionConfig> config); | 89 void set_candidate_config(scoped_ptr<CandidateSessionConfig> config); |
| 90 | 90 |
| 91 // Set the stubs which will handle messages from the host. | 91 // Set the stubs which will handle messages from the host. |
| 92 // The caller must ensure that stubs out-live the connection. | 92 // The caller must ensure that stubs out-live the connection. |
| 93 // Unless otherwise specified, all stubs must be set before Connect() | 93 // Unless otherwise specified, all stubs must be set before Connect() |
| 94 // is called. | 94 // is called. |
| 95 void set_client_stub(ClientStub* client_stub); | 95 void set_client_stub(ClientStub* client_stub); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 113 | 113 |
| 114 // Returns the session configuration that was negotiated with the host. | 114 // Returns the session configuration that was negotiated with the host. |
| 115 virtual const SessionConfig& config(); | 115 virtual const SessionConfig& config(); |
| 116 | 116 |
| 117 // Stubs for sending data to the host. | 117 // Stubs for sending data to the host. |
| 118 virtual ClipboardStub* clipboard_forwarder(); | 118 virtual ClipboardStub* clipboard_forwarder(); |
| 119 virtual HostStub* host_stub(); | 119 virtual HostStub* host_stub(); |
| 120 virtual InputStub* input_stub(); | 120 virtual InputStub* input_stub(); |
| 121 | 121 |
| 122 // SignalStrategy::StatusObserver interface. | 122 // SignalStrategy::StatusObserver interface. |
| 123 virtual void OnSignalStrategyStateChange( | 123 void OnSignalStrategyStateChange(SignalStrategy::State state) override; |
| 124 SignalStrategy::State state) override; | 124 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; |
| 125 virtual bool OnSignalStrategyIncomingStanza( | |
| 126 const buzz::XmlElement* stanza) override; | |
| 127 | 125 |
| 128 // SessionManager::Listener interface. | 126 // SessionManager::Listener interface. |
| 129 virtual void OnSessionManagerReady() override; | 127 void OnSessionManagerReady() override; |
| 130 virtual void OnIncomingSession( | 128 void OnIncomingSession( |
| 131 Session* session, | 129 Session* session, |
| 132 SessionManager::IncomingSessionResponse* response) override; | 130 SessionManager::IncomingSessionResponse* response) override; |
| 133 | 131 |
| 134 // Session::EventHandler interface. | 132 // Session::EventHandler interface. |
| 135 virtual void OnSessionStateChange(Session::State state) override; | 133 void OnSessionStateChange(Session::State state) override; |
| 136 virtual void OnSessionRouteChange(const std::string& channel_name, | 134 void OnSessionRouteChange(const std::string& channel_name, |
| 137 const TransportRoute& route) override; | 135 const TransportRoute& route) override; |
| 138 | 136 |
| 139 // MonitoredVideoStub::EventHandler interface. | 137 // MonitoredVideoStub::EventHandler interface. |
| 140 virtual void OnVideoChannelStatus(bool active); | 138 virtual void OnVideoChannelStatus(bool active); |
| 141 | 139 |
| 142 // Return the current state of ConnectionToHost. | 140 // Return the current state of ConnectionToHost. |
| 143 State state() const; | 141 State state() const; |
| 144 | 142 |
| 145 private: | 143 private: |
| 146 // Callbacks for channel initialization | 144 // Callbacks for channel initialization |
| 147 void OnChannelInitialized(bool successful); | 145 void OnChannelInitialized(bool successful); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 ErrorCode error_; | 183 ErrorCode error_; |
| 186 | 184 |
| 187 private: | 185 private: |
| 188 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 186 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
| 189 }; | 187 }; |
| 190 | 188 |
| 191 } // namespace protocol | 189 } // namespace protocol |
| 192 } // namespace remoting | 190 } // namespace remoting |
| 193 | 191 |
| 194 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 192 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
| OLD | NEW |