Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2161)

Unified Diff: ui/events/ozone/evdev/input_device_factory_evdev.cc

Issue 951063004: ozone: evdev: Keep track of settings & apply to new devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/class/struct/ Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/input_device_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc
index 020c28842afba510e8a7c04d5a883da634b94d3e..82d30959c1eb01cc1e79464ffe10a5eb9b7f380d 100644
--- a/ui/events/ozone/evdev/input_device_factory_evdev.cc
+++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc
@@ -318,6 +318,9 @@ void InputDeviceFactoryEvdev::AttachInputDevice(
converters_[path] = converter.release();
converters_[path]->Start();
UpdateDirtyFlags(converters_[path]);
+
+ // Sync settings to new device.
+ ApplyInputDeviceSettings();
}
if (--pending_device_changes_ == 0)
@@ -390,35 +393,10 @@ void InputDeviceFactoryEvdev::EnableInternalKeyboard() {
}
}
-void InputDeviceFactoryEvdev::SetTouchpadSensitivity(int value) {
- SetIntPropertyForOneType(DT_TOUCHPAD, "Pointer Sensitivity", value);
- SetIntPropertyForOneType(DT_TOUCHPAD, "Scroll Sensitivity", value);
-}
-
-void InputDeviceFactoryEvdev::SetTapToClick(bool enabled) {
- SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Enable", enabled);
-}
-
-void InputDeviceFactoryEvdev::SetThreeFingerClick(bool enabled) {
- SetBoolPropertyForOneType(DT_TOUCHPAD, "T5R2 Three Finger Click Enable",
- enabled);
-}
-
-void InputDeviceFactoryEvdev::SetTapDragging(bool enabled) {
- SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Drag Enable", enabled);
-}
-
-void InputDeviceFactoryEvdev::SetNaturalScroll(bool enabled) {
- SetBoolPropertyForOneType(DT_MULTITOUCH, "Australian Scrolling", enabled);
-}
-
-void InputDeviceFactoryEvdev::SetMouseSensitivity(int value) {
- SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", value);
- SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", value);
-}
-
-void InputDeviceFactoryEvdev::SetTapToClickPaused(bool state) {
- SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused", state);
+void InputDeviceFactoryEvdev::UpdateInputDeviceSettings(
+ const InputDeviceSettingsEvdev& settings) {
+ input_device_settings_ = settings;
+ ApplyInputDeviceSettings();
}
void InputDeviceFactoryEvdev::GetTouchDeviceStatus(
@@ -434,6 +412,31 @@ base::WeakPtr<InputDeviceFactoryEvdev> InputDeviceFactoryEvdev::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
+void InputDeviceFactoryEvdev::ApplyInputDeviceSettings() {
+ SetIntPropertyForOneType(DT_TOUCHPAD, "Pointer Sensitivity",
+ input_device_settings_.touchpad_sensitivity);
+ SetIntPropertyForOneType(DT_TOUCHPAD, "Scroll Sensitivity",
+ input_device_settings_.touchpad_sensitivity);
+
+ SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Enable",
+ input_device_settings_.tap_to_click_enabled);
+ SetBoolPropertyForOneType(DT_TOUCHPAD, "T5R2 Three Finger Click Enable",
+ input_device_settings_.three_finger_click_enabled);
+ SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Drag Enable",
+ input_device_settings_.tap_dragging_enabled);
+
+ SetBoolPropertyForOneType(DT_MULTITOUCH, "Australian Scrolling",
+ input_device_settings_.natural_scroll_enabled);
+
+ SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity",
+ input_device_settings_.mouse_sensitivity);
+ SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity",
+ input_device_settings_.mouse_sensitivity);
+
+ SetBoolPropertyForOneType(DT_TOUCHPAD, "Tap Paused",
+ input_device_settings_.tap_to_click_paused);
+}
+
void InputDeviceFactoryEvdev::UpdateDirtyFlags(
const EventConverterEvdev* converter) {
if (converter->HasTouchscreen())
« no previous file with comments | « ui/events/ozone/evdev/input_device_factory_evdev.h ('k') | ui/events/ozone/evdev/input_device_factory_evdev_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698