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

Side by Side Diff: remoting/host/chromoting_param_traits.cc

Issue 2529533003: Pass DesktopEnvironmentOptions form network to desktop process. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/host/chromoting_param_traits.h" 5 #include "remoting/host/chromoting_param_traits.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "ipc/ipc_message_utils.h" 10 #include "ipc/ipc_message_utils.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 // static 206 // static
207 void ParamTraits<remoting::ScreenResolution>::Log( 207 void ParamTraits<remoting::ScreenResolution>::Log(
208 const remoting::ScreenResolution& p, 208 const remoting::ScreenResolution& p,
209 std::string* l) { 209 std::string* l) {
210 l->append(base::StringPrintf("webrtc::ScreenResolution(%d, %d, %d, %d)", 210 l->append(base::StringPrintf("webrtc::ScreenResolution(%d, %d, %d, %d)",
211 p.dimensions().width(), p.dimensions().height(), 211 p.dimensions().width(), p.dimensions().height(),
212 p.dpi().x(), p.dpi().y())); 212 p.dpi().x(), p.dpi().y()));
213 } 213 }
214 214
215 // static
216 void ParamTraits<remoting::DesktopEnvironmentOptions>::Write(
217 base::Pickle* m,
218 const remoting::DesktopEnvironmentOptions& p) {
219 m->WriteBool(p.enable_curtaining());
220 m->WriteBool(p.enable_user_interface());
221 m->WriteBool(p.desktop_capture_options()->use_update_notifications());
222 m->WriteBool(p.desktop_capture_options()->disable_effects());
223 m->WriteBool(p.desktop_capture_options()->detect_updated_region());
224 #if defined(WEBRTC_WIN)
225 m->WriteBool(p.desktop_capture_options()->allow_use_magnification_api());
226 m->WriteBool(p.desktop_capture_options()->allow_directx_capturer());
227 #endif // defined(WEBRTC_WIN)
228 }
229
230 // static
231 bool ParamTraits<remoting::DesktopEnvironmentOptions>::Read(
232 const base::Pickle* m,
233 base::PickleIterator* iter,
234 remoting::DesktopEnvironmentOptions* r) {
235 *r = remoting::DesktopEnvironmentOptions::CreateDefault();
236 bool enable_curtaining;
237 bool enable_user_interface;
238 bool use_update_notifications;
239 bool disable_effects;
240 bool detect_updated_region;
241
242 if (!iter->ReadBool(&enable_curtaining) ||
243 !iter->ReadBool(&enable_user_interface) ||
244 !iter->ReadBool(&use_update_notifications) ||
245 !iter->ReadBool(&disable_effects) ||
246 !iter->ReadBool(&detect_updated_region)) {
247 return false;
248 }
249
250 r->set_enable_curtaining(enable_curtaining);
251 r->set_enable_user_interface(enable_user_interface);
252 r->desktop_capture_options()->set_use_update_notifications(
253 use_update_notifications);
254 r->desktop_capture_options()->set_detect_updated_region(
255 detect_updated_region);
256 r->desktop_capture_options()->set_disable_effects(disable_effects);
257
258 #if defined(WEBRTC_WIN)
259 bool allow_use_magnification_api;
260 bool allow_directx_capturer;
261
262 if (!iter->ReadBool(&allow_use_magnification_api) ||
263 !iter->ReadBool(&allow_directx_capturer)) {
264 return false;
265 }
266
267 r->desktop_capture_options()->set_allow_use_magnification_api(
268 allow_use_magnification_api);
269 r->desktop_capture_options()->set_allow_directx_capturer(
270 allow_directx_capturer);
271 #endif // defined(WEBRTC_WIN)
272
273 return true;
274 }
275
276 // static
277 void ParamTraits<remoting::DesktopEnvironmentOptions>::Log(
278 const remoting::DesktopEnvironmentOptions& p,
279 std::string* l) {
280 l->append("DesktopEnvironmentOptions()");
281 }
282
215 } // namespace IPC 283 } // namespace IPC
216 284
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698