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

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: Changes in synthetic_gesture_controller_unittest.cc 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 namespace content {
8
9 SyntheticPointerActionParams::SyntheticPointerActionParams()
10 : pointer_action_type_(PointerActionType::NOT_INITIALIZED), index_(-1) {}
11
12 SyntheticPointerActionParams::SyntheticPointerActionParams(
13 PointerActionType type)
14 : pointer_action_type_(type), index_(-1) {}
15
16 SyntheticPointerActionParams::SyntheticPointerActionParams(
17 const SyntheticPointerActionParams& other)
18 : SyntheticGestureParams(other),
19 pointer_action_type_(other.pointer_action_type()) {
20 switch (other.pointer_action_type()) {
21 case PointerActionType::PRESS:
22 case PointerActionType::MOVE:
23 position_ = other.position();
tdresser 2016/03/23 15:09:25 We generally avoid case statement fallthrough (exc
lanwei 2016/03/30 21:02:53 Done.
24 case PointerActionType::RELEASE:
25 index_ = other.index();
26 break;
27 default:
28 break;
29 }
30 }
31
32 SyntheticPointerActionParams::~SyntheticPointerActionParams() {}
33
34 SyntheticGestureParams::GestureType
35 SyntheticPointerActionParams::GetGestureType() const {
36 return POINTER_ACTION;
37 }
38
39 const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast(
40 const SyntheticGestureParams* gesture_params) {
41 DCHECK(gesture_params);
42 DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType());
43 return static_cast<const SyntheticPointerActionParams*>(gesture_params);
44 }
45
46 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698