Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Side by Side Diff: remoting/host/client_session.h

Issue 2091553002: Expose ClientSession details to Host Extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@desktop_environment
Patch Set: Adressing feedback Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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 <stdint.h> 8 #include <cstdint>
9 9 #include <memory>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/sequenced_task_runner_helpers.h" 15 #include "base/sequenced_task_runner_helpers.h"
16 #include "base/threading/non_thread_safe.h" 16 #include "base/threading/non_thread_safe.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
19 #include "remoting/host/client_session_control.h" 19 #include "remoting/host/client_session_control.h"
20 #include "remoting/host/client_session_details.h"
20 #include "remoting/host/host_extension_session_manager.h" 21 #include "remoting/host/host_extension_session_manager.h"
21 #include "remoting/host/remote_input_filter.h" 22 #include "remoting/host/remote_input_filter.h"
22 #include "remoting/protocol/clipboard_echo_filter.h" 23 #include "remoting/protocol/clipboard_echo_filter.h"
23 #include "remoting/protocol/clipboard_filter.h" 24 #include "remoting/protocol/clipboard_filter.h"
24 #include "remoting/protocol/clipboard_stub.h" 25 #include "remoting/protocol/clipboard_stub.h"
25 #include "remoting/protocol/connection_to_client.h" 26 #include "remoting/protocol/connection_to_client.h"
26 #include "remoting/protocol/host_stub.h" 27 #include "remoting/protocol/host_stub.h"
27 #include "remoting/protocol/input_event_tracker.h" 28 #include "remoting/protocol/input_event_tracker.h"
28 #include "remoting/protocol/input_filter.h" 29 #include "remoting/protocol/input_filter.h"
29 #include "remoting/protocol/input_stub.h" 30 #include "remoting/protocol/input_stub.h"
(...skipping 18 matching lines...) Expand all
48 namespace protocol { 49 namespace protocol {
49 class VideoLayout; 50 class VideoLayout;
50 } // namespace protocol 51 } // namespace protocol
51 52
52 // A ClientSession keeps a reference to a connection to a client, and maintains 53 // A ClientSession keeps a reference to a connection to a client, and maintains
53 // per-client state. 54 // per-client state.
54 class ClientSession : public base::NonThreadSafe, 55 class ClientSession : public base::NonThreadSafe,
55 public protocol::HostStub, 56 public protocol::HostStub,
56 public protocol::ConnectionToClient::EventHandler, 57 public protocol::ConnectionToClient::EventHandler,
57 public protocol::VideoStream::Observer, 58 public protocol::VideoStream::Observer,
58 public ClientSessionControl { 59 public ClientSessionControl,
60 public ClientSessionDetails {
59 public: 61 public:
60 // Callback interface for passing events to the ChromotingHost. 62 // Callback interface for passing events to the ChromotingHost.
61 class EventHandler { 63 class EventHandler {
62 public: 64 public:
63 // Called after authentication has started. 65 // Called after authentication has started.
64 virtual void OnSessionAuthenticating(ClientSession* client) = 0; 66 virtual void OnSessionAuthenticating(ClientSession* client) = 0;
65 67
66 // Called after authentication has finished successfully. 68 // Called after authentication has finished successfully.
67 virtual void OnSessionAuthenticated(ClientSession* client) = 0; 69 virtual void OnSessionAuthenticated(ClientSession* client) = 0;
68 70
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 void OnRouteChange(protocol::ConnectionToClient* connection, 129 void OnRouteChange(protocol::ConnectionToClient* connection,
128 const std::string& channel_name, 130 const std::string& channel_name,
129 const protocol::TransportRoute& route) override; 131 const protocol::TransportRoute& route) override;
130 132
131 // ClientSessionControl interface. 133 // ClientSessionControl interface.
132 const std::string& client_jid() const override; 134 const std::string& client_jid() const override;
133 void DisconnectSession(protocol::ErrorCode error) override; 135 void DisconnectSession(protocol::ErrorCode error) override;
134 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override; 136 void OnLocalMouseMoved(const webrtc::DesktopVector& position) override;
135 void SetDisableInputs(bool disable_inputs) override; 137 void SetDisableInputs(bool disable_inputs) override;
136 138
139 // ClientSessionDetails interface.
140 uint32_t desktop_session_id() const override;
141 ClientSessionControl* session_control() override;
142
137 protocol::ConnectionToClient* connection() const { return connection_.get(); } 143 protocol::ConnectionToClient* connection() const { return connection_.get(); }
138 144
139 bool is_authenticated() { return is_authenticated_; } 145 bool is_authenticated() { return is_authenticated_; }
140 146
141 const std::string* client_capabilities() const { 147 const std::string* client_capabilities() const {
142 return client_capabilities_.get(); 148 return client_capabilities_.get();
143 } 149 }
144 150
145 private: 151 private:
146 // Creates a proxy for sending clipboard events to the client. 152 // Creates a proxy for sending clipboard events to the client.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // Used to disable callbacks to |this| once DisconnectSession() has been 253 // Used to disable callbacks to |this| once DisconnectSession() has been
248 // called. 254 // called.
249 base::WeakPtrFactory<ClientSessionControl> weak_factory_; 255 base::WeakPtrFactory<ClientSessionControl> weak_factory_;
250 256
251 DISALLOW_COPY_AND_ASSIGN(ClientSession); 257 DISALLOW_COPY_AND_ASSIGN(ClientSession);
252 }; 258 };
253 259
254 } // namespace remoting 260 } // namespace remoting
255 261
256 #endif // REMOTING_HOST_CLIENT_SESSION_H_ 262 #endif // REMOTING_HOST_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/host/client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698