Commit abd0db30 authored by Kevin Schoedel's avatar Kevin Schoedel Committed by Commit Bot

Separate GestureConfigurationCast.

Cast humbly requests the ability to tweak its own gesture configuration.

Bug: b/77490018
Test: no functional change
Change-Id: I3db07364313ffaa072109c578b0d88b38498330a
Reviewed-on: https://chromium-review.googlesource.com/1026552Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Kevin Schoedel <kpschoedel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553337}
parent fd7b098c
......@@ -303,6 +303,8 @@ component("gesture_detection") {
if (is_android) {
sources += [ "gesture_detection/gesture_configuration_android.cc" ]
} else if (is_chromecast) {
sources += [ "gesture_detection/gesture_configuration_cast.cc" ]
} else if (use_aura) {
sources += [ "gesture_detection/gesture_configuration_aura.cc" ]
} else {
......
tdresser@chromium.org
per-file gesture_configuration_cast.cc=alexst@chromium.org
per-file gesture_configuration_cast.cc=kpschoedel@chromium.org
# TEAM: input-dev@chromium.org
# COMPONENT: Blink>Input
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "ui/events/event_switches.h"
namespace ui {
namespace {
class GestureConfigurationCast : public GestureConfiguration {
public:
~GestureConfigurationCast() override {
}
static GestureConfigurationCast* GetInstance() {
return base::Singleton<GestureConfigurationCast>::get();
}
private:
GestureConfigurationCast() : GestureConfiguration() {
set_double_tap_enabled(false);
set_double_tap_timeout_in_ms(semi_long_press_time_in_ms());
set_gesture_begin_end_types_enabled(true);
set_min_gesture_bounds_length(default_radius());
set_min_pinch_update_span_delta(
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kCompensateForUnstablePinchZoom)
? 5
: 0);
set_velocity_tracker_strategy(VelocityTracker::Strategy::LSQ2_RESTRICTED);
set_span_slop(max_touch_move_in_pixels_for_click() * 2);
set_swipe_enabled(true);
set_two_finger_tap_enabled(true);
set_fling_touchpad_tap_suppression_enabled(true);
set_fling_touchscreen_tap_suppression_enabled(true);
}
friend struct base::DefaultSingletonTraits<GestureConfigurationCast>;
DISALLOW_COPY_AND_ASSIGN(GestureConfigurationCast);
};
} // namespace
// Create a GestureConfigurationCast singleton instance when using Chromecast.
GestureConfiguration* GestureConfiguration::GetPlatformSpecificInstance() {
return GestureConfigurationCast::GetInstance();
}
} // namespace ui
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment