Index: remoting/client/plugin/chromoting_instance.cc |
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc |
index 45671e49573e9853d4657edc79bd68c01f3de1fd..bc204ca8c46091586fffa4bc4c2799fab7610664 100644 |
--- a/remoting/client/plugin/chromoting_instance.cc |
+++ b/remoting/client/plugin/chromoting_instance.cc |
@@ -137,12 +137,15 @@ logging::LogMessageHandlerFunction g_logging_old_handler = NULL; |
} // namespace |
-// String sent in the "hello" message to the plugin to describe features. |
+// String sent in the "hello" message to the webapp to describe features. |
const char ChromotingInstance::kApiFeatures[] = |
"highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey " |
"notifyClientDimensions notifyClientResolution pauseVideo pauseAudio " |
"asyncPin thirdPartyAuth"; |
+const char ChromotingInstance::kRequestedCapabilities[] = ""; |
+const char ChromotingInstance::kSupportedCapabilities[] = ""; |
+ |
bool ChromotingInstance::ParseAuthMethods(const std::string& auth_methods_str, |
ClientConfig* config) { |
std::vector<std::string> auth_methods; |
@@ -191,6 +194,9 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) |
data->SetInteger("apiVersion", kApiVersion); |
data->SetString("apiFeatures", kApiFeatures); |
data->SetInteger("apiMinVersion", kApiMinMessagingVersion); |
+ data->SetString("requestedCapabilities", kRequestedCapabilities); |
+ data->SetString("supportedCapabilities", kSupportedCapabilities); |
+ |
PostChromotingMessage("hello", data.Pass()); |
} |
@@ -297,6 +303,15 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) { |
config.fetch_secret_callback = |
base::Bind(&ChromotingInstance::FetchSecretFromString, shared_secret); |
} |
+ |
+ // Read the list of capabilities, if any. |
+ if (data->HasKey("capabilities")) { |
+ if (!data->GetString("capabilities", &config.capabilities)) { |
+ LOG(ERROR) << "Invalid connect() data."; |
+ return; |
+ } |
+ } |
+ |
Connect(config); |
} else if (method == "disconnect") { |
Disconnect(); |
@@ -478,6 +493,12 @@ void ChromotingInstance::OnConnectionReady(bool ready) { |
PostChromotingMessage("onConnectionReady", data.Pass()); |
} |
+void ChromotingInstance::SetCapabilities(const std::string& capabilities) { |
+ scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
+ data->SetString("capabilities", capabilities); |
+ PostChromotingMessage("setCapabilities", data.Pass()); |
+} |
+ |
void ChromotingInstance::FetchSecretFromDialog( |
const protocol::SecretFetchedCallback& secret_fetched_callback) { |
// Once the Session object calls this function, it won't continue the |