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

Unified Diff: remoting/host/chromoting_param_traits.cc

Issue 2529533003: Pass DesktopEnvironmentOptions form network to desktop process. (Closed)
Patch Set: Created 4 years, 1 month 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/host/chromoting_param_traits.cc
diff --git a/remoting/host/chromoting_param_traits.cc b/remoting/host/chromoting_param_traits.cc
index 6e47494ec30560851997f344aa12ad31d5278179..de62d761859b3b4132fb4b84ba9cfe952f1b7575 100644
--- a/remoting/host/chromoting_param_traits.cc
+++ b/remoting/host/chromoting_param_traits.cc
@@ -212,5 +212,73 @@ void ParamTraits<remoting::ScreenResolution>::Log(
p.dpi().x(), p.dpi().y()));
}
+// static
+void ParamTraits<remoting::DesktopEnvironmentOptions>::Write(
+ base::Pickle* m,
+ const remoting::DesktopEnvironmentOptions& p) {
+ m->WriteBool(p.enable_curtaining());
+ m->WriteBool(p.enable_user_interface());
+ m->WriteBool(p.desktop_capture_options()->use_update_notifications());
+ m->WriteBool(p.desktop_capture_options()->disable_effects());
+ m->WriteBool(p.desktop_capture_options()->detect_updated_region());
+#if defined(WEBRTC_WIN)
+ m->WriteBool(p.desktop_capture_options()->allow_use_magnification_api());
+ m->WriteBool(p.desktop_capture_options()->allow_directx_capturer());
+#endif // defined(WEBRTC_WIN)
+}
+
+// static
+bool ParamTraits<remoting::DesktopEnvironmentOptions>::Read(
+ const base::Pickle* m,
+ base::PickleIterator* iter,
+ remoting::DesktopEnvironmentOptions* r) {
+ *r = remoting::DesktopEnvironmentOptions::CreateDefault();
+ bool enable_curtaining;
+ bool enable_user_interface;
+ bool use_update_notifications;
+ bool disable_effects;
+ bool detect_updated_region;
+
+ if (!iter->ReadBool(&enable_curtaining) ||
+ !iter->ReadBool(&enable_user_interface) ||
+ !iter->ReadBool(&use_update_notifications) ||
+ !iter->ReadBool(&disable_effects) ||
+ !iter->ReadBool(&detect_updated_region)) {
+ return false;
+ }
+
+ r->set_enable_curtaining(enable_curtaining);
+ r->set_enable_user_interface(enable_user_interface);
+ r->desktop_capture_options()->set_use_update_notifications(
+ use_update_notifications);
+ r->desktop_capture_options()->set_detect_updated_region(
+ detect_updated_region);
+ r->desktop_capture_options()->set_disable_effects(disable_effects);
+
+#if defined(WEBRTC_WIN)
+ bool allow_use_magnification_api;
+ bool allow_directx_capturer;
+
+ if (!iter->ReadBool(&allow_use_magnification_api) ||
+ !iter->ReadBool(&allow_directx_capturer)) {
+ return false;
+ }
+
+ r->desktop_capture_options()->set_allow_use_magnification_api(
+ allow_use_magnification_api);
+ r->desktop_capture_options()->set_allow_directx_capturer(
+ allow_directx_capturer);
+#endif // defined(WEBRTC_WIN)
+
+ return true;
+}
+
+// static
+void ParamTraits<remoting::DesktopEnvironmentOptions>::Log(
+ const remoting::DesktopEnvironmentOptions& p,
+ std::string* l) {
+ l->append("DesktopEnvironmentOptions()");
+}
+
} // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698