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

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 13932020: Set the initial resolution of an RDP session to the client screen resolution if it is available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed remoting_unittests Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698