| OLD | NEW |
| 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 "content/common/input/input_param_traits.h" | 5 #include "content/common/input/input_param_traits.h" |
| 6 | 6 |
| 7 #include "content/common/content_param_traits.h" | 7 #include "content/common/content_param_traits.h" |
| 8 #include "content/common/input/synthetic_pinch_gesture_params.h" | 8 #include "content/common/input/synthetic_pinch_gesture_params.h" |
| 9 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 9 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
| 10 #include "content/common/input/web_input_event_traits.h" | 10 #include "content/common/input/web_input_event_traits.h" |
| 11 #include "content/common/input_messages.h" | 11 #include "content/common/input_messages.h" |
| 12 | 12 |
| 13 namespace IPC { | 13 namespace IPC { |
| 14 namespace { | 14 namespace { |
| 15 template<typename GestureType> | 15 template<typename GestureType> |
| 16 scoped_ptr<content::SyntheticGestureParams> ReadGestureParams( | 16 scoped_ptr<content::SyntheticGestureParams> ReadGestureParams( |
| 17 const Message* m, | 17 const Message* m, |
| 18 PickleIterator* iter) | 18 PickleIterator* iter) |
| 19 { | 19 { |
| 20 scoped_ptr<GestureType> gesture_params(new GestureType); | 20 scoped_ptr<GestureType> gesture_params(new GestureType); |
| 21 if (!ReadParam(m, iter, gesture_params.get())) | 21 if (!ReadParam(m, iter, gesture_params.get())) |
| 22 return scoped_ptr<content::SyntheticGestureParams>(); | 22 return scoped_ptr<content::SyntheticGestureParams>(); |
| 23 | 23 |
| 24 return gesture_params.template PassAs<content::SyntheticGestureParams>(); | 24 return gesture_params.Pass(); |
| 25 } | 25 } |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 void ParamTraits<content::ScopedWebInputEvent>::Write(Message* m, | 28 void ParamTraits<content::ScopedWebInputEvent>::Write(Message* m, |
| 29 const param_type& p) { | 29 const param_type& p) { |
| 30 bool valid_web_event = !!p; | 30 bool valid_web_event = !!p; |
| 31 WriteParam(m, valid_web_event); | 31 WriteParam(m, valid_web_event); |
| 32 if (valid_web_event) | 32 if (valid_web_event) |
| 33 WriteParam(m, static_cast<WebInputEventPointer>(p.get())); | 33 WriteParam(m, static_cast<WebInputEventPointer>(p.get())); |
| 34 } | 34 } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 break; | 119 break; |
| 120 case content::SyntheticGestureParams::TAP_GESTURE: | 120 case content::SyntheticGestureParams::TAP_GESTURE: |
| 121 LogParam( | 121 LogParam( |
| 122 *content::SyntheticTapGestureParams::Cast(p.gesture_params()), | 122 *content::SyntheticTapGestureParams::Cast(p.gesture_params()), |
| 123 l); | 123 l); |
| 124 break; | 124 break; |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace IPC | 128 } // namespace IPC |
| OLD | NEW |