Index: content/browser/renderer_host/tap_suppression_controller_aura.cc |
diff --git a/content/browser/renderer_host/tap_suppression_controller_aura.cc b/content/browser/renderer_host/tap_suppression_controller_aura.cc |
index 0f99f5c28668678617ec04e12ef40d5d2b15997b..9fba17b81e3726c235ebd829e0fa6b454f45bf30 100644 |
--- a/content/browser/renderer_host/tap_suppression_controller_aura.cc |
+++ b/content/browser/renderer_host/tap_suppression_controller_aura.cc |
@@ -10,47 +10,38 @@ |
#include "base/string_number_conversions.h" |
#include "content/browser/renderer_host/render_widget_host_impl.h" |
#include "content/public/common/content_switches.h" |
+#include "ui/base/gestures/gesture_configuration.h" |
namespace { |
-// Default maxium time between a mousedown/mouseup pair that is considered to |
-// be a suppressable tap. |
-static const int kMaxiumTapGapTimeMs = 200; |
- |
-// Default maximum time between a GestureFlingCancel and a mousedown such that |
-// the mousedown is considered associated with the cancel event. |
-static const int kMaxiumCancelToDownTimeMs = 400; |
- |
// Sets |*value| to |switchKey| if it exists or sets it to |defaultValue|. |
static void GetFlingParamHelper(int* value, int defaultValue, |
const char switchKey[]) { |
mohsen
2013/01/03 15:20:28
The following change is to compute the parameter v
|
- if (*value < 0) { |
- *value = defaultValue; |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- std::string command_line_param = |
- command_line->GetSwitchValueASCII(switchKey); |
- if (!command_line_param.empty()) { |
- int v; |
- if (base::StringToInt(command_line_param, &v)) |
- *value = static_cast<int>(v); |
- } |
- DCHECK_GT(*value, 0); |
+ *value = defaultValue; |
+ CommandLine* command_line = CommandLine::ForCurrentProcess(); |
mohsen
2013/01/03 15:20:28
Currently the values can be set in command line, t
rjkroege
2013/01/03 22:42:49
remove in this CL -- which admits some simplificat
|
+ std::string command_line_param = |
+ command_line->GetSwitchValueASCII(switchKey); |
+ if (!command_line_param.empty()) { |
+ int v; |
+ if (base::StringToInt(command_line_param, &v)) |
+ *value = static_cast<int>(v); |
} |
} |
static int GetMaxiumTapGapTimeMs() { |
- static int maximum_tap_gap_time_ms = -1; |
+ int maximum_tap_gap_time_ms = -1; |
GetFlingParamHelper(&maximum_tap_gap_time_ms, |
- kMaxiumTapGapTimeMs, |
+ ui::GestureConfiguration::fling_max_tap_gap_time_in_ms(), |
switches::kFlingTapSuppressMaxGap); |
return maximum_tap_gap_time_ms; |
} |
static int GetMaxiumCancelToDownTimeMs() { |
- static int maximum_cancel_to_down_time_ms = -1; |
- GetFlingParamHelper(&maximum_cancel_to_down_time_ms, |
- kMaxiumCancelToDownTimeMs, |
- switches::kFlingTapSuppressMaxDown); |
+ int maximum_cancel_to_down_time_ms = -1; |
+ GetFlingParamHelper( |
+ &maximum_cancel_to_down_time_ms, |
+ ui::GestureConfiguration::fling_max_cancel_to_down_time_in_ms(), |
+ switches::kFlingTapSuppressMaxDown); |
return maximum_cancel_to_down_time_ms; |
} |