diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 03:56:29 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 03:56:29 +0000 |
commit | 7503994167af517416a28f25480c0e8026829794 (patch) | |
tree | b510d289b620e69157f9333166b0aff49ee18098 /remoting/client | |
parent | af793c8dd516623ee92e22719dcd3228527c9e02 (diff) | |
download | chromium_src-7503994167af517416a28f25480c0e8026829794.zip chromium_src-7503994167af517416a28f25480c0e8026829794.tar.gz chromium_src-7503994167af517416a28f25480c0e8026829794.tar.bz2 |
Add notifyClientDimensions API to the Chromoting Client plugin.
BUG=110212
TEST=Will be testable via subsequent API-consumer CL.
Review URL: http://codereview.chromium.org/10262019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 22 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.h | 1 |
2 files changed, 22 insertions, 1 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index c72b578..6bb34a8 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; diff --git a/remoting/client/plugin/chromoting_instance.h b/remoting/client/plugin/chromoting_instance.h index fb34751..66e00b1 100644 --- a/remoting/client/plugin/chromoting_instance.h +++ b/remoting/client/plugin/chromoting_instance.h @@ -145,6 +145,7 @@ class ChromotingInstance : void RemapKey(uint32 in_usb_keycode, uint32 out_usb_keycode); void TrapKey(uint32 usb_keycode, bool trap); void SendClipboardItem(const std::string& mime_type, const std::string& item); + void NotifyClientDimensions(int width, int height); // Return statistics record by ChromotingClient. // If no connection is currently active then NULL will be returned. |