1a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 2a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)// found in the LICENSE file. 4a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 5a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "content/common/input/synthetic_tap_gesture_params.h" 6a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 7a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "base/logging.h" 8a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 9a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)namespace content { 10a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 11effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// Set the default tap duration to 50ms to lie within the bounds of the Aura 12effb81e5f8246d0db0270817048dc992db66e9fbBen Murdoch// gesture recognizer for identifying clicks (currently 0.01s-0.80s). 13effb81e5f8246d0db0270817048dc992db66e9fbBen MurdochSyntheticTapGestureParams::SyntheticTapGestureParams() : duration_ms(50) {} 14a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 15a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)SyntheticTapGestureParams::SyntheticTapGestureParams( 16a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) const SyntheticTapGestureParams& other) 17a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) : SyntheticGestureParams(other), 18a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) position(other.position), 19a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) duration_ms(other.duration_ms) {} 20a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 21a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)SyntheticTapGestureParams::~SyntheticTapGestureParams() {} 22a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 23a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)SyntheticGestureParams::GestureType SyntheticTapGestureParams::GetGestureType() 24a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) const { 25a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return TAP_GESTURE; 26a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)} 27a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)const SyntheticTapGestureParams* SyntheticTapGestureParams::Cast( 29a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) const SyntheticGestureParams* gesture_params) { 30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) DCHECK(gesture_params); 31a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) DCHECK_EQ(TAP_GESTURE, gesture_params->GetGestureType()); 32a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) return static_cast<const SyntheticTapGestureParams*>(gesture_params); 33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)} 34a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 35a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)} // namespace content 36