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

Side by Side Diff: content/common/input/synthetic_pointer_action_params.cc

Issue 1707943002: Add SyntheticPointerActionParams used in Chromedriver extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use get functions in the IPC message Created 4 years, 9 months 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/common/input/synthetic_pointer_action_params.h"
6
7 #include "base/logging.h"
8
9 namespace content {
10
11 SyntheticPointerActionParams::SyntheticPointerActionParams() {}
12
13 SyntheticPointerActionParams::SyntheticPointerActionParams(
14 PointerActionType type)
15 : pointer_action_type(type) {}
16
17 SyntheticPointerActionParams::SyntheticPointerActionParams(
18 const SyntheticPointerActionParams& other)
19 : SyntheticGestureParams(other),
20 pointer_action_type(other.pointer_action_type) {
21 if (other.pointer_action_type !=
22 SyntheticGestureParams::PointerActionType::PROCESS)
23 index_ = other.index();
24 if (other.pointer_action_type ==
25 SyntheticGestureParams::PointerActionType::PRESS ||
26 other.pointer_action_type ==
27 SyntheticGestureParams::PointerActionType::MOVE)
28 position_ = other.position();
29 }
30
31 SyntheticPointerActionParams::~SyntheticPointerActionParams() {}
32
33 SyntheticGestureParams::GestureType
34 SyntheticPointerActionParams::GetGestureType() const {
35 return POINTER_ACTION;
36 }
37
38 const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast(
39 const SyntheticGestureParams* gesture_params) {
40 DCHECK(gesture_params);
41 DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType());
42 return static_cast<const SyntheticPointerActionParams*>(gesture_params);
43 }
44
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698