Commit ccfc6f97 authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

events: ozone: Move features to ui/events/ozone/features.h

We don't want direct dependencies on internals of the evdev component, so
move features defined there to a common file.

Using these files from //chrome/browser would break dependency checking
through "gn check", except that checks for that tree are disabled (bug
949535).

Bug: 1026406

Change-Id: I0fbf9d2c0f466b4d9dbdd903540fdc4972f397ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1927209
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarKevin Schoedel <kpschoedel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717733}
parent 754462aa
......@@ -3772,6 +3772,7 @@ jumbo_static_library("browser") {
"//chromeos/strings",
"//components/services/font:lib",
"//components/services/font/public/mojom",
"//ui/events/ozone",
"//ui/ozone",
]
allow_circular_includes_from += [ "//chrome/browser/chromeos" ]
......
......@@ -189,7 +189,7 @@
#include "components/arc/arc_features.h"
#include "printing/printing_features_chromeos.h"
#include "third_party/cros_system_api/switches/chrome_switches.h"
#include "ui/events/ozone/evdev/touch_filter/palm_detection_filter_factory.h"
#include "ui/events/ozone/features.h"
#endif // OS_CHROMEOS
#if defined(OS_MACOSX)
......
......@@ -23,6 +23,8 @@ component("ozone") {
"device/udev/device_manager_udev.cc",
"device/udev/device_manager_udev.h",
"events_ozone_export.h",
"features.cc",
"features.h",
"gamepad/gamepad_event.cc",
"gamepad/gamepad_event.h",
"gamepad/gamepad_observer.h",
......
......@@ -18,30 +18,9 @@
#include "ui/events/ozone/evdev/touch_filter/open_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/palm_model/onedevice_train_palm_detection_filter_model.h"
#include "ui/events/ozone/features.h"
namespace ui {
const base::Feature kEnableHeuristicPalmDetectionFilter{
"EnableHeuristicPalmDetectionFilter", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kEnableNeuralPalmDetectionFilter{
"EnableNeuralPalmDetectionFilter", base::FEATURE_DISABLED_BY_DEFAULT};
EVENTS_OZONE_EVDEV_EXPORT
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial{
&kEnableNeuralPalmDetectionFilter, "neural_palm_radius_polynomial", ""};
const base::FeatureParam<double> kHeuristicCancelThresholdSeconds{
&kEnableHeuristicPalmDetectionFilter,
"heuristic_palm_cancel_threshold_seconds", 0.4};
const base::FeatureParam<double> kHeuristicHoldThresholdSeconds{
&kEnableHeuristicPalmDetectionFilter,
"heuristic_palm_hold_threshold_seconds", 1.0};
const base::FeatureParam<int> kHeuristicStrokeCount{
&kEnableHeuristicPalmDetectionFilter, "heuristic_palm_stroke_count", 0};
namespace internal {
std::vector<float> ParseRadiusPolynomial(const std::string& radius_string) {
......
......@@ -18,24 +18,6 @@
namespace ui {
EVENTS_OZONE_EVDEV_EXPORT
extern const base::Feature kEnableHeuristicPalmDetectionFilter;
EVENTS_OZONE_EVDEV_EXPORT
extern const base::Feature kEnableNeuralPalmDetectionFilter;
EVENTS_OZONE_EVDEV_EXPORT
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial;
EVENTS_OZONE_EVDEV_EXPORT
extern const base::FeatureParam<double> kHeuristicCancelThresholdSeconds;
EVENTS_OZONE_EVDEV_EXPORT
extern const base::FeatureParam<double> kHeuristicHoldThresholdSeconds;
EVENTS_OZONE_EVDEV_EXPORT
extern const base::FeatureParam<int> kHeuristicStrokeCount;
EVENTS_OZONE_EVDEV_EXPORT std::unique_ptr<PalmDetectionFilter>
CreatePalmDetectionFilter(const EventDeviceInfo& devinfo,
SharedPalmDetectionFilterState* shared_palm_state);
......
......@@ -15,6 +15,7 @@
#include "ui/events/ozone/evdev/touch_filter/open_palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/palm_detection_filter.h"
#include "ui/events/ozone/evdev/touch_filter/shared_palm_detection_filter_state.h"
#include "ui/events/ozone/features.h"
namespace ui {
......
// Copyright 2019 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/ozone/features.h"
namespace ui {
const base::Feature kEnableHeuristicPalmDetectionFilter{
"EnableHeuristicPalmDetectionFilter", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kEnableNeuralPalmDetectionFilter{
"EnableNeuralPalmDetectionFilter", base::FEATURE_DISABLED_BY_DEFAULT};
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial{
&kEnableNeuralPalmDetectionFilter, "neural_palm_radius_polynomial", ""};
const base::FeatureParam<double> kHeuristicCancelThresholdSeconds{
&kEnableHeuristicPalmDetectionFilter,
"heuristic_palm_cancel_threshold_seconds", 0.4};
const base::FeatureParam<double> kHeuristicHoldThresholdSeconds{
&kEnableHeuristicPalmDetectionFilter,
"heuristic_palm_hold_threshold_seconds", 1.0};
const base::FeatureParam<int> kHeuristicStrokeCount{
&kEnableHeuristicPalmDetectionFilter, "heuristic_palm_stroke_count", 0};
} // namespace ui
// Copyright 2019 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.
#ifndef UI_EVENTS_OZONE_FEATURES_H_
#define UI_EVENTS_OZONE_FEATURES_H_
#include "base/component_export.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "ui/events/ozone/events_ozone_export.h"
namespace ui {
EVENTS_OZONE_EXPORT
extern const base::Feature kEnableHeuristicPalmDetectionFilter;
EVENTS_OZONE_EXPORT
extern const base::Feature kEnableNeuralPalmDetectionFilter;
EVENTS_OZONE_EXPORT
extern const base::FeatureParam<std::string> kNeuralPalmRadiusPolynomial;
EVENTS_OZONE_EXPORT
extern const base::FeatureParam<double> kHeuristicCancelThresholdSeconds;
EVENTS_OZONE_EXPORT
extern const base::FeatureParam<double> kHeuristicHoldThresholdSeconds;
EVENTS_OZONE_EXPORT
extern const base::FeatureParam<int> kHeuristicStrokeCount;
} // namespace ui
#endif // UI_EVENTS_OZONE_FEATURES_H_
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