summaryrefslogtreecommitdiffstats
path: root/content/common/input/synthetic_tap_gesture_params.cc
blob: c3bb8ffee18b669e1c65d365870884dd8ee5f3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2013 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/common/input/synthetic_tap_gesture_params.h"

#include "base/logging.h"

namespace content {

// Set the default tap duration to 50ms to lie within the bounds of the Aura
// gesture recognizer for identifying clicks (currently 0.01s-0.80s).
SyntheticTapGestureParams::SyntheticTapGestureParams() : duration_ms(50) {}

SyntheticTapGestureParams::SyntheticTapGestureParams(
    const SyntheticTapGestureParams& other)
    : SyntheticGestureParams(other),
      position(other.position),
      duration_ms(other.duration_ms) {}

SyntheticTapGestureParams::~SyntheticTapGestureParams() {}

SyntheticGestureParams::GestureType SyntheticTapGestureParams::GetGestureType()
    const {
  return TAP_GESTURE;
}

const SyntheticTapGestureParams* SyntheticTapGestureParams::Cast(
    const SyntheticGestureParams* gesture_params) {
  DCHECK(gesture_params);
  DCHECK_EQ(TAP_GESTURE, gesture_params->GetGestureType());
  return static_cast<const SyntheticTapGestureParams*>(gesture_params);
}

}  // namespace content