Index: remoting/client/plugin/chromoting_instance.cc |
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc |
index 057c4a1efe39e4ea232e748bd7a71f710fb6268e..1dc0b617f77fb932c9384e9f9db8c4904422c963 100644 |
--- a/remoting/client/plugin/chromoting_instance.cc |
+++ b/remoting/client/plugin/chromoting_instance.cc |
@@ -133,12 +133,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; |
@@ -187,6 +190,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()); |
} |
@@ -293,6 +299,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")) { |
Sergey Ulanov
2013/04/18 00:34:53
Don't need this. GetString() will return false if
alexeypa (please no reviews)
2013/04/18 18:56:36
This is needed to detect the case when "capabiliti
|
+ if (!data->GetString("capabilities", &config.capabilities)) { |
+ LOG(ERROR) << "Invalid connect() data."; |
+ return; |
+ } |
+ } |
+ |
Connect(config); |
} else if (method == "disconnect") { |
Disconnect(); |
@@ -474,6 +489,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 |