OLD | NEW |
1 // Copyright (c) 2011 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_HOST_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/time.h" | 11 #include "base/time.h" |
(...skipping 27 matching lines...) Expand all Loading... |
39 // returns. | 39 // returns. |
40 virtual void OnSessionAuthenticationFailed(ClientSession* client) = 0; | 40 virtual void OnSessionAuthenticationFailed(ClientSession* client) = 0; |
41 | 41 |
42 // Called after connection has failed or after the client closed it. | 42 // Called after connection has failed or after the client closed it. |
43 virtual void OnSessionClosed(ClientSession* client) = 0; | 43 virtual void OnSessionClosed(ClientSession* client) = 0; |
44 | 44 |
45 // Called to notify of each message's sequence number. The | 45 // Called to notify of each message's sequence number. The |
46 // callback must not tear down this object. | 46 // callback must not tear down this object. |
47 virtual void OnSessionSequenceNumber(ClientSession* client, | 47 virtual void OnSessionSequenceNumber(ClientSession* client, |
48 int64 sequence_number) = 0; | 48 int64 sequence_number) = 0; |
| 49 |
| 50 // Called on notification of a route change event, when a channel is |
| 51 // connected. |
| 52 virtual void OnSessionIpAddress(ClientSession* client, |
| 53 const std::string& channel_name, |
| 54 const net::IPEndPoint& end_point) = 0; |
49 }; | 55 }; |
50 | 56 |
51 // Takes ownership of |connection|. Does not take ownership of | 57 // Takes ownership of |connection|. Does not take ownership of |
52 // |event_handler|, |input_stub| or |capturer|. | 58 // |event_handler|, |input_stub| or |capturer|. |
53 ClientSession(EventHandler* event_handler, | 59 ClientSession(EventHandler* event_handler, |
54 protocol::ConnectionToClient* connection, | 60 protocol::ConnectionToClient* connection, |
55 protocol::InputStub* input_stub, | 61 protocol::InputStub* input_stub, |
56 Capturer* capturer); | 62 Capturer* capturer); |
57 virtual ~ClientSession(); | 63 virtual ~ClientSession(); |
58 | 64 |
59 // protocol::InputStub interface. | 65 // protocol::InputStub interface. |
60 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; | 66 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; |
61 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; | 67 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; |
62 | 68 |
63 // protocol::ConnectionToClient::EventHandler interface. | 69 // protocol::ConnectionToClient::EventHandler interface. |
64 virtual void OnConnectionOpened( | 70 virtual void OnConnectionOpened( |
65 protocol::ConnectionToClient* connection) OVERRIDE; | 71 protocol::ConnectionToClient* connection) OVERRIDE; |
66 virtual void OnConnectionClosed( | 72 virtual void OnConnectionClosed( |
67 protocol::ConnectionToClient* connection) OVERRIDE; | 73 protocol::ConnectionToClient* connection) OVERRIDE; |
68 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, | 74 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, |
69 protocol::Session::Error error) OVERRIDE; | 75 protocol::Session::Error error) OVERRIDE; |
70 virtual void OnSequenceNumberUpdated( | 76 virtual void OnSequenceNumberUpdated( |
71 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; | 77 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; |
| 78 virtual void OnClientIpAddress(protocol::ConnectionToClient* connection, |
| 79 const std::string& channel_name, |
| 80 const net::IPEndPoint& end_point) OVERRIDE; |
72 | 81 |
73 // Disconnects the session and destroys the transport. Event handler | 82 // Disconnects the session and destroys the transport. Event handler |
74 // is guaranteed not to be called after this method is called. Can | 83 // is guaranteed not to be called after this method is called. Can |
75 // be called multiple times. The object should not be used after | 84 // be called multiple times. The object should not be used after |
76 // this method returns. | 85 // this method returns. |
77 void Disconnect(); | 86 void Disconnect(); |
78 | 87 |
79 protocol::ConnectionToClient* connection() const { | 88 protocol::ConnectionToClient* connection() const { |
80 return connection_.get(); | 89 return connection_.get(); |
81 } | 90 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Set of keys that are currently pressed down by the user. This is used so | 159 // Set of keys that are currently pressed down by the user. This is used so |
151 // we can release them if the user disconnects. | 160 // we can release them if the user disconnects. |
152 std::set<int> pressed_keys_; | 161 std::set<int> pressed_keys_; |
153 | 162 |
154 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 163 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
155 }; | 164 }; |
156 | 165 |
157 } // namespace remoting | 166 } // namespace remoting |
158 | 167 |
159 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 168 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |