1f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// found in the LICENSE file.
4f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
5a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#ifndef UI_GFX_ANDROID_VIEW_CONFIGURATION_H_
6a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#define UI_GFX_ANDROID_VIEW_CONFIGURATION_H_
7f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
8f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include <jni.h>
9f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
10a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "ui/gfx/gfx_export.h"
11a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
12a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)namespace gfx {
13f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
14f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)// Provides access to Android's ViewConfiguration for gesture-related constants.
15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Note: All methods may be safely called from any thread.
16a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)class GFX_EXPORT ViewConfiguration {
17f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) public:
18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static int GetDoubleTapTimeoutInMs();
19f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static int GetLongPressTimeoutInMs();
20f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static int GetTapTimeoutInMs();
21f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  // Dimensionless coefficient of friction.
23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  static float GetScrollFriction();
24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
25f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static int GetMaximumFlingVelocityInPixelsPerSecond();
26f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static int GetMinimumFlingVelocityInPixelsPerSecond();
27f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  static int GetTouchSlopInPixels();
29a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  static int GetDoubleTapSlopInPixels();
30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)
31a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  static int GetMinScalingSpanInPixels();
32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)  static int GetMinScalingTouchMajorInPixels();
33a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)
34f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  // Registers methods with JNI and returns true if succeeded.
35f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)  static bool RegisterViewConfiguration(JNIEnv* env);
36f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)};
37f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
38a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)}  // namespace gfx
39f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)
40a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#endif  // UI_GFX_ANDROID_VIEW_CONFIGURATION_H_
41