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 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ | 5 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ |
6 #define CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ | 6 #define CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ |
7 | 7 |
| 8 #include <utility> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
11 #include "content/common/input/synthetic_gesture_params.h" | 13 #include "content/common/input/synthetic_gesture_params.h" |
12 | 14 |
13 namespace content { | 15 namespace content { |
14 | 16 |
15 // Wraps an object of type SyntheticGestureParams (or one of its subclasses) for | 17 // Wraps an object of type SyntheticGestureParams (or one of its subclasses) for |
16 // sending it over IPC. | 18 // sending it over IPC. |
17 class CONTENT_EXPORT SyntheticGesturePacket { | 19 class CONTENT_EXPORT SyntheticGesturePacket { |
18 public: | 20 public: |
19 SyntheticGesturePacket(); | 21 SyntheticGesturePacket(); |
20 ~SyntheticGesturePacket(); | 22 ~SyntheticGesturePacket(); |
21 | 23 |
22 void set_gesture_params(scoped_ptr<SyntheticGestureParams> gesture_params) { | 24 void set_gesture_params(scoped_ptr<SyntheticGestureParams> gesture_params) { |
23 gesture_params_ = gesture_params.Pass(); | 25 gesture_params_ = std::move(gesture_params); |
24 } | 26 } |
25 const SyntheticGestureParams* gesture_params() const { | 27 const SyntheticGestureParams* gesture_params() const { |
26 return gesture_params_.get(); | 28 return gesture_params_.get(); |
27 } | 29 } |
28 scoped_ptr<SyntheticGestureParams> pass_gesture_params() { | 30 scoped_ptr<SyntheticGestureParams> pass_gesture_params() { |
29 return gesture_params_.Pass(); | 31 return std::move(gesture_params_); |
30 } | 32 } |
31 | 33 |
32 private: | 34 private: |
33 scoped_ptr<SyntheticGestureParams> gesture_params_; | 35 scoped_ptr<SyntheticGestureParams> gesture_params_; |
34 | 36 |
35 DISALLOW_COPY_AND_ASSIGN(SyntheticGesturePacket); | 37 DISALLOW_COPY_AND_ASSIGN(SyntheticGesturePacket); |
36 }; | 38 }; |
37 | 39 |
38 } // namespace content | 40 } // namespace content |
39 | 41 |
40 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ | 42 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_GESTURE_PACKET_H_ |
OLD | NEW |