Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / common / input / synthetic_gesture_params.cc
blobaff9e9637d64f50e7b74e8fd5761657bc09bc97a
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.
5 #include "content/common/input/synthetic_gesture_params.h"
7 namespace content {
9 SyntheticGestureParams::SyntheticGestureParams()
10 : gesture_source_type(DEFAULT_INPUT) {}
12 SyntheticGestureParams::SyntheticGestureParams(
13 const SyntheticGestureParams& other)
14 : gesture_source_type(other.gesture_source_type) {}
16 SyntheticGestureParams::~SyntheticGestureParams() {}
18 bool SyntheticGestureParams::IsGestureSourceTypeSupported(
19 GestureSourceType gesture_source_type) {
20 if (gesture_source_type == DEFAULT_INPUT)
21 return true;
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 // Android supports mouse wheel events, but mouse drag is not yet
30 // supported. See crbug.com/468806.
31 return gesture_source_type == TOUCH_INPUT ||
32 gesture_source_type == MOUSE_INPUT;
33 #else
34 return gesture_source_type == MOUSE_INPUT;
35 #endif
38 } // namespace content