| Index: content/browser/renderer_host/input/synthetic_pointer_action_controller.cc
|
| diff --git a/content/browser/renderer_host/input/synthetic_pointer_action_controller.cc b/content/browser/renderer_host/input/synthetic_pointer_action_controller.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1ee3e7441932dc46d506155e5d5b76300d823921
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/input/synthetic_pointer_action_controller.cc
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/browser/renderer_host/input/synthetic_pointer_action_controller.h"
|
| +
|
| +namespace content {
|
| +
|
| +SyntheticPointerActionController::SyntheticPointerActionController() {
|
| + std::fill(index_map_.begin(), index_map_.end(), -1);
|
| +}
|
| +SyntheticPointerActionController::~SyntheticPointerActionController() {}
|
| +
|
| +std::unique_ptr<SyntheticGesture>
|
| +SyntheticPointerActionController::CreateSyntheticPointerAction(
|
| + const SyntheticPointerActionListParams& gesture_params) {
|
| + if (!synthetic_pointer_)
|
| + SetSyntheticPointer(gesture_params);
|
| +
|
| + std::unique_ptr<SyntheticGesture> synthetic_gesture =
|
| + std::unique_ptr<SyntheticGesture>(new SyntheticPointerAction(
|
| + gesture_params, synthetic_pointer_.get(), &index_map_));
|
| + return synthetic_gesture;
|
| +}
|
| +
|
| +void SyntheticPointerActionController::SetSyntheticPointer(
|
| + const SyntheticPointerActionListParams& gesture_params) {
|
| + DCHECK_GE(gesture_params.param_list.size(), 0u);
|
| + SyntheticPointerActionParams action_params = gesture_params.param_list[0];
|
| +
|
| + if (action_params.gesture_source_type ==
|
| + SyntheticGestureParams::DEFAULT_INPUT) {
|
| + action_params.gesture_source_type = default_type_;
|
| + }
|
| + DCHECK_NE(action_params.gesture_source_type,
|
| + SyntheticGestureParams::DEFAULT_INPUT);
|
| + synthetic_pointer_ =
|
| + SyntheticPointer::Create(action_params.gesture_source_type);
|
| +}
|
| +
|
| +void SyntheticPointerActionController::ResetSyntheticPointer() {
|
| + synthetic_pointer_.reset();
|
| +}
|
| +
|
| +void SyntheticPointerActionController::SetDefaultGestureSourceType(
|
| + SyntheticGestureParams::GestureSourceType default_type) {
|
| + default_type_ = default_type;
|
| +}
|
| +
|
| +} // namespace content
|
|
|