Use multiline attribute to check for IA2_STATE_MULTILINE.
[chromium-blink-merge.git] / content / browser / renderer_host / overscroll_configuration.cc
blobf7c5579f56ffb17330fa4862881da87e8a05f3bb
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"
9 namespace {
11 float g_horiz_threshold_complete = 0.25f;
12 float g_vert_threshold_complete = 0.20f;
14 float g_horiz_threshold_start_touchscreen = 50.f;
15 float g_horiz_threshold_start_touchpad = 50.f;
16 float g_vert_threshold_start = 0.f;
18 float g_horiz_resist_after = 30.f;
19 float g_vert_resist_after = 30.f;
23 namespace content {
25 void SetOverscrollConfig(OverscrollConfig config, float value) {
26 switch (config) {
27 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE:
28 g_horiz_threshold_complete = value;
29 break;
31 case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE:
32 g_vert_threshold_complete = value;
33 break;
35 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN:
36 g_horiz_threshold_start_touchscreen = value;
37 break;
39 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD:
40 g_horiz_threshold_start_touchpad = value;
41 break;
43 case OVERSCROLL_CONFIG_VERT_THRESHOLD_START:
44 g_vert_threshold_start = value;
45 break;
47 case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER:
48 g_horiz_resist_after = value;
49 break;
51 case OVERSCROLL_CONFIG_VERT_RESIST_AFTER:
52 g_vert_resist_after = value;
53 break;
55 case OVERSCROLL_CONFIG_NONE:
56 case OVERSCROLL_CONFIG_COUNT:
57 NOTREACHED();
61 float GetOverscrollConfig(OverscrollConfig config) {
62 switch (config) {
63 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE:
64 return g_horiz_threshold_complete;
66 case OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE:
67 return g_vert_threshold_complete;
69 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHSCREEN:
70 return g_horiz_threshold_start_touchscreen;
72 case OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START_TOUCHPAD:
73 return g_horiz_threshold_start_touchpad;
75 case OVERSCROLL_CONFIG_VERT_THRESHOLD_START:
76 return g_vert_threshold_start;
78 case OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER:
79 return g_horiz_resist_after;
81 case OVERSCROLL_CONFIG_VERT_RESIST_AFTER:
82 return g_vert_resist_after;
84 case OVERSCROLL_CONFIG_NONE:
85 case OVERSCROLL_CONFIG_COUNT:
86 NOTREACHED();
89 return -1.f;
92 } // namespace content