1 // Copyright (c) 2012 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/public/browser/overscroll_configuration.h"
7 #include "base/logging.h"
11 float g_horiz_threshold_complete
= 0.25f
;
12 float g_vert_threshold_complete
= 0.20f
;
14 float g_min_threshold_start
= 30.f
;
16 float g_horiz_resist_after
= 30.f
;
17 float g_vert_resist_after
= 30.f
;
23 void SetOverscrollConfig(OverscrollConfig config
, float value
) {
25 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE
:
26 g_horiz_threshold_complete
= value
;
29 case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE
:
30 g_vert_threshold_complete
= value
;
33 case OVERSCROLL_CONFIG_MIN_THRESHOLD_START
:
34 g_min_threshold_start
= value
;
37 case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER
:
38 g_horiz_resist_after
= value
;
41 case OVERSCROLL_CONFIG_VERT_RESIST_AFTER
:
42 g_vert_resist_after
= value
;
45 case OVERSCROLL_CONFIG_NONE
:
46 case OVERSCROLL_CONFIG_COUNT
:
51 float GetOverscrollConfig(OverscrollConfig config
) {
53 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE
:
54 return g_horiz_threshold_complete
;
56 case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE
:
57 return g_vert_threshold_complete
;
59 case OVERSCROLL_CONFIG_MIN_THRESHOLD_START
:
60 return g_min_threshold_start
;
62 case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER
:
63 return g_horiz_resist_after
;
65 case OVERSCROLL_CONFIG_VERT_RESIST_AFTER
:
66 return g_vert_resist_after
;
68 case OVERSCROLL_CONFIG_NONE
:
69 case OVERSCROLL_CONFIG_COUNT
:
76 } // namespace content