summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/system
diff options
context:
space:
mode:
authordenniskempin@chromium.org <denniskempin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 18:15:59 +0000
committerdenniskempin@chromium.org <denniskempin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-03 18:15:59 +0000
commit15877542c33babc237586513096f3077c313449c (patch)
treee326acd6fb32a98de59c87b4346fbf9837466e01 /chrome/browser/chromeos/system
parent336a09422a499c354d966f9519c7da7b933cba7b (diff)
downloadchromium_src-15877542c33babc237586513096f3077c313449c.zip
chromium_src-15877542c33babc237586513096f3077c313449c.tar.gz
chromium_src-15877542c33babc237586513096f3077c313449c.tar.bz2
Don't handle NaturalScroll in Chrome but pass it to CMT instead
In order to support mice via CMT (Project Cobra) we will have to do the natural scroll handling in the CMT driver instead of Chrome. BUG=chromium:285663 TEST=test with touchpads and traditional mice. Everything should work as before, touchpad should have natural scroll applied, scroll wheels should not. Test changing the natural scroll property and see if it's applied correctly. Also test if touch mice have natural scroll applied. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260926 Review URL: https://codereview.chromium.org/212603005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/system')
-rw-r--r--chrome/browser/chromeos/system/fake_input_device_settings.cc6
-rw-r--r--chrome/browser/chromeos/system/fake_input_device_settings.h2
-rw-r--r--chrome/browser/chromeos/system/input_device_settings.cc22
-rw-r--r--chrome/browser/chromeos/system/input_device_settings.h7
4 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/system/fake_input_device_settings.cc b/chrome/browser/chromeos/system/fake_input_device_settings.cc
index b422f97..50e8038 100644
--- a/chrome/browser/chromeos/system/fake_input_device_settings.cc
+++ b/chrome/browser/chromeos/system/fake_input_device_settings.cc
@@ -46,6 +46,12 @@ void FakeInputDeviceSettings::SetTapDragging(bool enabled) {
UpdateTouchpadSettings(settings);
}
+void FakeInputDeviceSettings::SetNaturalScroll(bool enabled) {
+ TouchpadSettings settings;
+ settings.SetNaturalScroll(enabled);
+ UpdateTouchpadSettings(settings);
+}
+
void FakeInputDeviceSettings::MouseExists(
const DeviceExistsCallback& callback) {
callback.Run(false);
diff --git a/chrome/browser/chromeos/system/fake_input_device_settings.h b/chrome/browser/chromeos/system/fake_input_device_settings.h
index 78e7038..b1aa6b8 100644
--- a/chrome/browser/chromeos/system/fake_input_device_settings.h
+++ b/chrome/browser/chromeos/system/fake_input_device_settings.h
@@ -30,6 +30,8 @@ class FakeInputDeviceSettings : public InputDeviceSettings {
virtual void UpdateMouseSettings(const MouseSettings& settings) OVERRIDE;
virtual void SetMouseSensitivity(int value) OVERRIDE;
virtual void SetPrimaryButtonRight(bool right) OVERRIDE;
+ virtual void SetNaturalScroll(bool enabled) OVERRIDE;
+
virtual bool ForceKeyboardDrivenUINavigation() OVERRIDE;
virtual void ReapplyTouchpadSettings() OVERRIDE;
virtual void ReapplyMouseSettings() OVERRIDE;
diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc
index 10cc5a6..e92b31a 100644
--- a/chrome/browser/chromeos/system/input_device_settings.cc
+++ b/chrome/browser/chromeos/system/input_device_settings.cc
@@ -151,6 +151,7 @@ class InputDeviceSettingsImpl : public InputDeviceSettings {
virtual void SetTapToClick(bool enabled) OVERRIDE;
virtual void SetThreeFingerClick(bool enabled) OVERRIDE;
virtual void SetTapDragging(bool enabled) OVERRIDE;
+ virtual void SetNaturalScroll(bool enabled) OVERRIDE;
virtual void MouseExists(const DeviceExistsCallback& callback) OVERRIDE;
virtual void UpdateMouseSettings(const MouseSettings& update) OVERRIDE;
virtual void SetMouseSensitivity(int value) OVERRIDE;
@@ -186,6 +187,12 @@ void InputDeviceSettingsImpl::SetTouchpadSensitivity(int value) {
UpdateTouchpadSettings(settings);
}
+void InputDeviceSettingsImpl::SetNaturalScroll(bool enabled) {
+ TouchpadSettings settings;
+ settings.SetNaturalScroll(enabled);
+ UpdateTouchpadSettings(settings);
+}
+
void InputDeviceSettingsImpl::SetTapToClick(bool enabled) {
TouchpadSettings settings;
settings.SetTapToClick(enabled);
@@ -276,6 +283,7 @@ TouchpadSettings& TouchpadSettings::operator=(const TouchpadSettings& other) {
tap_to_click_ = other.tap_to_click_;
three_finger_click_ = other.three_finger_click_;
tap_dragging_ = other.tap_dragging_;
+ natural_scroll_ = other.natural_scroll_;
}
return *this;
}
@@ -296,6 +304,14 @@ bool TouchpadSettings::GetTapToClick() const {
return tap_to_click_.value();
}
+void TouchpadSettings::SetNaturalScroll(bool enabled) {
+ natural_scroll_.Set(enabled);
+}
+
+bool TouchpadSettings::GetNaturalScroll() const {
+ return natural_scroll_.value();
+}
+
void TouchpadSettings::SetThreeFingerClick(bool enabled) {
three_finger_click_.Set(enabled);
}
@@ -339,6 +355,12 @@ bool TouchpadSettings::Update(const TouchpadSettings& settings,
if (argv)
AddTPControlArguments("tapdrag", tap_dragging_.value(), argv);
}
+ if (natural_scroll_.Update(settings.natural_scroll_)) {
+ updated = true;
+ if (argv)
+ AddTPControlArguments("australian_scrolling", natural_scroll_.value(),
+ argv);
+ }
return updated;
}
diff --git a/chrome/browser/chromeos/system/input_device_settings.h b/chrome/browser/chromeos/system/input_device_settings.h
index 901106a..ba938a1 100644
--- a/chrome/browser/chromeos/system/input_device_settings.h
+++ b/chrome/browser/chromeos/system/input_device_settings.h
@@ -96,6 +96,9 @@ class TouchpadSettings {
void SetTapDragging(bool enabled);
bool GetTapDragging() const;
+ void SetNaturalScroll(bool enabled);
+ bool GetNaturalScroll() const;
+
// Updates |this| with |settings|. If at least one setting was updated returns
// true.
// |argv| is filled with arguments of script, that should be launched in order
@@ -107,6 +110,7 @@ class TouchpadSettings {
internal::Optional<bool> tap_to_click_;
internal::Optional<bool> three_finger_click_;
internal::Optional<bool> tap_dragging_;
+ internal::Optional<bool> natural_scroll_;
};
// Auxiliary class used to update several mouse settings at a time. User
@@ -173,6 +177,9 @@ class InputDeviceSettings {
// Turns tap-dragging on/off.
virtual void SetTapDragging(bool enabled) = 0;
+ // Turns natural scrolling on/off for all devices except wheel mice
+ virtual void SetNaturalScroll(bool enabled) = 0;
+
// Calls |callback| asynchronously after determining if a mouse is connected.
virtual void MouseExists(const DeviceExistsCallback& callback) = 0;