Index: remoting/host/client_session.cc |
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc |
index fd1e441d7d673966286828f562c52936cb76909c..b2624a83ce6073e0428f00db9ba28914048823b5 100644 |
--- a/remoting/host/client_session.cc |
+++ b/remoting/host/client_session.cc |
@@ -18,6 +18,7 @@ |
#include "remoting/host/audio_capturer.h" |
#include "remoting/host/audio_scheduler.h" |
#include "remoting/host/desktop_environment.h" |
+#include "remoting/host/host_extension_session.h" |
#include "remoting/host/input_injector.h" |
#include "remoting/host/screen_controls.h" |
#include "remoting/host/screen_resolution.h" |
@@ -98,6 +99,25 @@ ClientSession::~ClientSession() { |
connection_.reset(); |
} |
+void ClientSession::AddExtensionSession( |
+ scoped_ptr<HostExtensionSession> extension_session) { |
+ DCHECK(CalledOnValidThread()); |
+ |
+ extension_sessions_.push_back(extension_session.release()); |
+} |
+ |
+void ClientSession::AddHostCapabilities(const std::string& capabilities) { |
+ DCHECK(CalledOnValidThread()); |
+ |
+ if (capabilities.empty()) |
+ return; |
+ |
+ if (!host_capabilities_.empty()) |
+ host_capabilities_.append(" "); |
Wez
2014/05/28 23:03:41
See comment in ChromotingHost re doing this accumu
dcaiafa
2014/05/29 00:03:16
As you mentioned in the comment's message, AddHost
|
+ |
+ host_capabilities_.append(capabilities); |
+} |
+ |
void ClientSession::NotifyClientResolution( |
const protocol::ClientResolution& resolution) { |
DCHECK(CalledOnValidThread()); |
@@ -168,6 +188,7 @@ void ClientSession::SetCapabilities( |
*client_capabilities_ = capabilities.capabilities(); |
VLOG(1) << "Client capabilities: " << *client_capabilities_; |
+ event_handler_->OnClientCapabilities(this); |
// Calculate the set of capabilities enabled by both client and host and |
// pass it to the desktop environment if it is available. |
@@ -204,6 +225,13 @@ void ClientSession::DeliverClientMessage( |
HOST_LOG << "gnubby auth is not enabled"; |
} |
return; |
+ } else { |
+ for(HostExtensionSessionList::iterator it = extension_sessions_.begin(); |
+ it != extension_sessions_.end(); ++it) { |
+ // Extension returns |true| to indicate that the message was handled. |
+ if ((*it)->OnExtensionMessage(this, message)) |
+ return; |
+ } |
} |
} |
HOST_LOG << "Unexpected message received: " |
@@ -253,7 +281,7 @@ void ClientSession::OnConnectionAuthenticated( |
return; |
} |
- host_capabilities_ = desktop_environment_->GetCapabilities(); |
+ AddHostCapabilities(desktop_environment_->GetCapabilities()); |
// Ignore protocol::Capabilities messages from the client if it does not |
// support any capabilities. |
@@ -261,6 +289,8 @@ void ClientSession::OnConnectionAuthenticated( |
VLOG(1) << "The client does not support any capabilities."; |
client_capabilities_ = make_scoped_ptr(new std::string()); |
+ event_handler_->OnClientCapabilities(this); |
+ |
desktop_environment_->SetCapabilities(*client_capabilities_); |
} |