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

Side by Side Diff: content/browser/renderer_host/input/synthetic_pointer_action_controller.cc

Issue 2336803003: Make SyntheticPointerAction to flush the pointer action sequence (Closed)
Patch Set: controller Created 4 years, 3 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/browser/renderer_host/input/synthetic_pointer_action_controlle r.h"
6
7 namespace content {
8
9 SyntheticPointerActionController::SyntheticPointerActionController() {
10 std::fill(index_map_.begin(), index_map_.end(), -1);
11 }
12 SyntheticPointerActionController::~SyntheticPointerActionController() {}
13
14 std::unique_ptr<SyntheticGesture>
15 SyntheticPointerActionController::CreateSyntheticPointerAction(
16 const SyntheticPointerActionListParams& gesture_params) {
17 if (!synthetic_pointer_)
18 SetSyntheticPointer(gesture_params);
19
20 std::unique_ptr<SyntheticGesture> synthetic_gesture =
21 std::unique_ptr<SyntheticGesture>(new SyntheticPointerAction(
22 gesture_params, synthetic_pointer_.get(), &index_map_));
23 return synthetic_gesture;
24 }
25
26 void SyntheticPointerActionController::SetSyntheticPointer(
27 const SyntheticPointerActionListParams& gesture_params) {
28 SyntheticGestureParams::GestureSourceType gesture_source_type =
29 gesture_params.gesture_source_type;
30 if (gesture_source_type == SyntheticGestureParams::DEFAULT_INPUT)
31 gesture_source_type = default_type_;
32 DCHECK_NE(gesture_source_type, SyntheticGestureParams::DEFAULT_INPUT);
33 synthetic_pointer_ = SyntheticPointer::Create(gesture_source_type);
34 }
35
36 void SyntheticPointerActionController::ResetSyntheticPointer() {
37 synthetic_pointer_.reset();
38 }
39
40 void SyntheticPointerActionController::SetDefaultGestureSourceType(
41 SyntheticGestureParams::GestureSourceType default_type) {
42 default_type_ = default_type;
43 }
44
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698