190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// found in the LICENSE file. 490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#ifndef REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ 690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#define REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ 790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ipc/ipc_message.h" 990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ipc/ipc_param_traits.h" 1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "remoting/host/screen_resolution.h" 116e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 1290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 136e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)#include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" 1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 1590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)namespace IPC { 1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 1790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)template <> 1890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)struct ParamTraits<webrtc::DesktopVector> { 1990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) typedef webrtc::DesktopVector param_type; 2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Write(Message* m, const param_type& p); 2190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static bool Read(const Message* m, PickleIterator* iter, param_type* r); 2290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Log(const param_type& p, std::string* l); 2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}; 2490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)template <> 2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)struct ParamTraits<webrtc::DesktopSize> { 2790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) typedef webrtc::DesktopSize param_type; 2890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Write(Message* m, const param_type& p); 2990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static bool Read(const Message* m, PickleIterator* iter, param_type* r); 3090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Log(const param_type& p, std::string* l); 3190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}; 3290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 3390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)template <> 3490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)struct ParamTraits<webrtc::DesktopRect> { 3590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) typedef webrtc::DesktopRect param_type; 3690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Write(Message* m, const param_type& p); 3790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static bool Read(const Message* m, PickleIterator* iter, param_type* r); 3890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Log(const param_type& p, std::string* l); 3990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}; 4090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 4190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)template <> 426e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)struct ParamTraits<webrtc::MouseCursor> { 436e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) typedef webrtc::MouseCursor param_type; 446e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) static void Write(Message* m, const param_type& p); 456e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) static bool Read(const Message* m, PickleIterator* iter, param_type* r); 466e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) static void Log(const param_type& p, std::string* l); 476e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)}; 486e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles) 496e8cce623b6e4fe0c9e4af605d675dd9d0338c38Torne (Richard Coles)template <> 5090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)struct ParamTraits<remoting::ScreenResolution> { 5190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) typedef remoting::ScreenResolution param_type; 5290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Write(Message* m, const param_type& p); 5390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static bool Read(const Message* m, PickleIterator* iter, param_type* r); 5490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) static void Log(const param_type& p, std::string* l); 5590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}; 5690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 5790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)} // namespace IPC 5890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 5990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#endif // REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ 60