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

Side by Side Diff: chrome/browser/chromeos/system/fake_input_device_settings.h

Issue 2006083002: Use fake Input Device Settings with chrome://device-emulator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DevicePageTestsFixes
Patch Set: make dependent on a11y fix Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_ 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/chromeos/system/input_device_settings.h" 10 #include "chrome/browser/chromeos/system/input_device_settings.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 namespace system { 13 namespace system {
14 14
15 // This fake just memorizes current values of input devices settings. 15 // This fake just memorizes current values of input devices settings.
16 class FakeInputDeviceSettings : public InputDeviceSettings { 16 class FakeInputDeviceSettings : public InputDeviceSettings,
17 public InputDeviceSettings::FakeInterface {
17 public: 18 public:
18 FakeInputDeviceSettings(); 19 FakeInputDeviceSettings();
19 ~FakeInputDeviceSettings() override; 20 ~FakeInputDeviceSettings() override;
20 21
21 // Overridden from InputDeviceSettings. 22 // Overridden from InputDeviceSettings.
22 void TouchpadExists(const DeviceExistsCallback& callback) override; 23 void TouchpadExists(const DeviceExistsCallback& callback) override;
23 void UpdateTouchpadSettings(const TouchpadSettings& settings) override; 24 void UpdateTouchpadSettings(const TouchpadSettings& settings) override;
24 void SetTouchpadSensitivity(int value) override; 25 void SetTouchpadSensitivity(int value) override;
25 void SetTapToClick(bool enabled) override; 26 void SetTapToClick(bool enabled) override;
26 void SetThreeFingerClick(bool enabled) override; 27 void SetThreeFingerClick(bool enabled) override;
27 void SetTapDragging(bool enabled) override; 28 void SetTapDragging(bool enabled) override;
28 void MouseExists(const DeviceExistsCallback& callback) override; 29 void MouseExists(const DeviceExistsCallback& callback) override;
29 void UpdateMouseSettings(const MouseSettings& settings) override; 30 void UpdateMouseSettings(const MouseSettings& settings) override;
30 void SetMouseSensitivity(int value) override; 31 void SetMouseSensitivity(int value) override;
31 void SetPrimaryButtonRight(bool right) override; 32 void SetPrimaryButtonRight(bool right) override;
32 void SetNaturalScroll(bool enabled) override; 33 void SetNaturalScroll(bool enabled) override;
33 void ReapplyTouchpadSettings() override; 34 void ReapplyTouchpadSettings() override;
34 void ReapplyMouseSettings() override; 35 void ReapplyMouseSettings() override;
36 InputDeviceSettings::FakeInterface* GetFakeInterface() override;
35 37
36 const TouchpadSettings& current_touchpad_settings() const { 38 // Overridden from InputDeviceSettings::FakeInterface.
37 return current_touchpad_settings_; 39 void set_touchpad_exists(bool exists) override;
38 } 40 void set_mouse_exists(bool exists) override;
39 41 const TouchpadSettings& current_touchpad_settings() const override;
40 const MouseSettings& current_mouse_settings() const { 42 const MouseSettings& current_mouse_settings() const override;
41 return current_mouse_settings_;
42 }
43 43
44 private: 44 private:
45 TouchpadSettings current_touchpad_settings_; 45 TouchpadSettings current_touchpad_settings_;
46 MouseSettings current_mouse_settings_; 46 MouseSettings current_mouse_settings_;
47 47
48 bool touchpad_exists_ = true;
49 bool mouse_exists_ = true;
50
48 DISALLOW_COPY_AND_ASSIGN(FakeInputDeviceSettings); 51 DISALLOW_COPY_AND_ASSIGN(FakeInputDeviceSettings);
49 }; 52 };
50 53
51 } // namespace system 54 } // namespace system
52 } // namespace chromeos 55 } // namespace chromeos
53 56
54 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_ 57 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_FAKE_INPUT_DEVICE_SETTINGS_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences_unittest.cc ('k') | chrome/browser/chromeos/system/fake_input_device_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698