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

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

Issue 10262019: Add notifyClientDimensions API to the Chromoting Client plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing space. Created 8 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
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 1671d71f7fa0c6bd493aea1d976410f4bb4c35fc..3ca1779a986075205f8d0b4af5f1a78fdb97d553 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -102,7 +102,8 @@ static base::LazyInstance<base::Lock>::Leaky
// String sent in the "hello" message to the plugin to describe features.
const char ChromotingInstance::kApiFeatures[] =
- "highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey";
+ "highQualityScaling injectKeyEvent sendClipboardItem remapKey trapKey "
+ "notifyClientDimensions";
bool ChromotingInstance::ParseAuthMethods(const std::string& auth_methods_str,
ClientConfig* config) {
@@ -299,6 +300,15 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
return;
}
SendClipboardItem(mime_type, item);
+ } else if (method == "notifyClientDimensions") {
+ int width = 0;
+ int height = 0;
+ if (!data->GetInteger("width", &width) ||
+ !data->GetInteger("height", &height)) {
+ LOG(ERROR) << "Invalid notifyClientDimensions.";
+ return;
+ }
+ NotifyClientDimensions(width, height);
}
}
@@ -472,6 +482,16 @@ void ChromotingInstance::SendClipboardItem(const std::string& mime_type,
host_connection_->clipboard_stub()->InjectClipboardEvent(event);
}
+void ChromotingInstance::NotifyClientDimensions(int width, int height) {
+ if (!host_connection_.get()) {
+ return;
+ }
+ protocol::ClientDimensions client_dimensions;
+ client_dimensions.set_width(width);
+ client_dimensions.set_height(height);
+ host_connection_->host_stub()->NotifyClientDimensions(client_dimensions);
+}
+
ChromotingStats* ChromotingInstance::GetStats() {
if (!client_.get())
return NULL;
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698