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

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

Issue 17511004: Added the desktop shape fields to VideoPacket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback. Created 7 years, 6 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/client/plugin/pepper_view.cc » ('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 7bcc08462d889558d7472b387040b5f162cfece0..d772cfe9b4a57892ee4558f1a4090b32fc6cb776 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -147,7 +147,7 @@ const char ChromotingInstance::kApiFeatures[] =
"asyncPin thirdPartyAuth pinlessAuth";
const char ChromotingInstance::kRequestedCapabilities[] = "";
-const char ChromotingInstance::kSupportedCapabilities[] = "";
+const char ChromotingInstance::kSupportedCapabilities[] = "desktopShape";
bool ChromotingInstance::ParseAuthMethods(const std::string& auth_methods_str,
ClientConfig* config) {
@@ -469,6 +469,28 @@ void ChromotingInstance::SetDesktopSize(const SkISize& size,
PostChromotingMessage("onDesktopSize", data.Pass());
}
+void ChromotingInstance::SetDesktopShape(const SkRegion& shape) {
+ if (desktop_shape_ && shape == *desktop_shape_)
+ return;
+
+ desktop_shape_.reset(new SkRegion(shape));
+
+ scoped_ptr<base::ListValue> rects_value(new base::ListValue());
+ for (SkRegion::Iterator i(shape); !i.done(); i.next()) {
+ SkIRect rect = i.rect();
+ scoped_ptr<base::ListValue> rect_value(new base::ListValue());
+ rect_value->AppendInteger(rect.x());
+ rect_value->AppendInteger(rect.y());
+ rect_value->AppendInteger(rect.width());
+ rect_value->AppendInteger(rect.height());
+ rects_value->Append(rect_value.release());
+ }
+
+ scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
+ data->Set("rects", rects_value.release());
+ PostChromotingMessage("onDesktopShape", data.Pass());
+}
+
void ChromotingInstance::OnConnectionState(
protocol::ConnectionToHost::State state,
protocol::ErrorCode error) {
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/client/plugin/pepper_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698