| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool authenticated() const { | 67 bool authenticated() const { |
| 68 return authenticated_; | 68 return authenticated_; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void set_awaiting_continue_approval(bool awaiting) { | 71 void set_awaiting_continue_approval(bool awaiting) { |
| 72 awaiting_continue_approval_ = awaiting; | 72 awaiting_continue_approval_ = awaiting; |
| 73 } | 73 } |
| 74 | 74 |
| 75 const std::string& client_jid() { return client_jid_; } |
| 76 |
| 75 // Indicate that local mouse activity has been detected. This causes remote | 77 // Indicate that local mouse activity has been detected. This causes remote |
| 76 // inputs to be ignored for a short time so that the local user will always | 78 // inputs to be ignored for a short time so that the local user will always |
| 77 // have the upper hand in 'pointer wars'. | 79 // have the upper hand in 'pointer wars'. |
| 78 void LocalMouseMoved(const gfx::Point& new_pos); | 80 void LocalMouseMoved(const gfx::Point& new_pos); |
| 79 | 81 |
| 80 bool ShouldIgnoreRemoteMouseInput(const protocol::MouseEvent* event) const; | 82 bool ShouldIgnoreRemoteMouseInput(const protocol::MouseEvent* event) const; |
| 81 bool ShouldIgnoreRemoteKeyboardInput(const protocol::KeyEvent* event) const; | 83 bool ShouldIgnoreRemoteKeyboardInput(const protocol::KeyEvent* event) const; |
| 82 | 84 |
| 83 private: | 85 private: |
| 84 friend class base::RefCountedThreadSafe<ClientSession>; | 86 friend class base::RefCountedThreadSafe<ClientSession>; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 95 void UnpressKeys(); | 97 void UnpressKeys(); |
| 96 | 98 |
| 97 EventHandler* event_handler_; | 99 EventHandler* event_handler_; |
| 98 | 100 |
| 99 // A factory for user authenticators. | 101 // A factory for user authenticators. |
| 100 scoped_ptr<UserAuthenticator> user_authenticator_; | 102 scoped_ptr<UserAuthenticator> user_authenticator_; |
| 101 | 103 |
| 102 // The connection to the client. | 104 // The connection to the client. |
| 103 scoped_refptr<protocol::ConnectionToClient> connection_; | 105 scoped_refptr<protocol::ConnectionToClient> connection_; |
| 104 | 106 |
| 107 std::string client_jid_; |
| 108 |
| 105 // The input stub to which this object delegates. | 109 // The input stub to which this object delegates. |
| 106 protocol::InputStub* input_stub_; | 110 protocol::InputStub* input_stub_; |
| 107 | 111 |
| 108 // Whether this client is authenticated. | 112 // Whether this client is authenticated. |
| 109 bool authenticated_; | 113 bool authenticated_; |
| 110 | 114 |
| 111 // Whether or not inputs from this client are blocked pending approval from | 115 // Whether or not inputs from this client are blocked pending approval from |
| 112 // the host user to continue the connection. | 116 // the host user to continue the connection. |
| 113 bool awaiting_continue_approval_; | 117 bool awaiting_continue_approval_; |
| 114 | 118 |
| 115 // State to control remote input blocking while the local pointer is in use. | 119 // State to control remote input blocking while the local pointer is in use. |
| 116 uint32 remote_mouse_button_state_; | 120 uint32 remote_mouse_button_state_; |
| 117 | 121 |
| 118 // Queue of recently-injected mouse positions. This is used to detect whether | 122 // Queue of recently-injected mouse positions. This is used to detect whether |
| 119 // mouse events from the local input monitor are echoes of injected positions, | 123 // mouse events from the local input monitor are echoes of injected positions, |
| 120 // or genuine mouse movements of a local input device. | 124 // or genuine mouse movements of a local input device. |
| 121 std::list<gfx::Point> injected_mouse_positions_; | 125 std::list<gfx::Point> injected_mouse_positions_; |
| 122 | 126 |
| 123 base::Time latest_local_input_time_; | 127 base::Time latest_local_input_time_; |
| 124 std::set<int> pressed_keys_; | 128 std::set<int> pressed_keys_; |
| 125 | 129 |
| 126 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 130 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 } // namespace remoting | 133 } // namespace remoting |
| 130 | 134 |
| 131 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 135 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |