Home | History | Annotate | Download | only in input
      1 // Copyright 2013 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_gesture_params.h"
      6 
      7 namespace content {
      8 
      9 SyntheticGestureParams::SyntheticGestureParams()
     10     : gesture_source_type(DEFAULT_INPUT) {}
     11 
     12 SyntheticGestureParams::SyntheticGestureParams(
     13     const SyntheticGestureParams& other)
     14     : gesture_source_type(other.gesture_source_type) {}
     15 
     16 SyntheticGestureParams::~SyntheticGestureParams() {}
     17 
     18 bool SyntheticGestureParams::IsGestureSourceTypeSupported(
     19     GestureSourceType gesture_source_type) {
     20   if (gesture_source_type == DEFAULT_INPUT)
     21     return true;
     22 
     23   // These values should change very rarely. We thus hard-code them here rather
     24   // than having to query the brower's SyntheticGestureTarget.
     25 #if defined(USE_AURA)
     26   return gesture_source_type == TOUCH_INPUT ||
     27          gesture_source_type == MOUSE_INPUT;
     28 #elif defined(OS_ANDROID)
     29   return gesture_source_type == TOUCH_INPUT;
     30 #else
     31   return gesture_source_type == MOUSE_INPUT;
     32 #endif
     33 }
     34 
     35 }  // namespace content
     36