| OLD | NEW |
| 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 UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 5 #ifndef UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
| 6 #define UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 6 #define UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 14 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/ozone/ozone_export.h" | 16 #include "ui/ozone/ozone_export.h" |
| 15 | 17 |
| 16 namespace base { | 18 namespace base { |
| 17 class TimeDelta; | 19 class TimeDelta; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace ui { | 22 namespace ui { |
| 21 | 23 |
| 22 enum class DomCode; | 24 enum class DomCode; |
| 23 | 25 |
| 24 // Platform-specific interface for controlling input devices. | 26 // Platform-specific interface for controlling input devices. |
| 25 // | 27 // |
| 26 // The object provides methods for the preference page to configure input | 28 // The object provides methods for the preference page to configure input |
| 27 // devices w.r.t. the user setting. On ChromeOS, this replaces the inputcontrol | 29 // devices w.r.t. the user setting. On ChromeOS, this replaces the inputcontrol |
| 28 // script that is originally located at /opt/google/chrome/. | 30 // script that is originally located at /opt/google/chrome/. |
| 29 class OZONE_EXPORT InputController { | 31 class OZONE_EXPORT InputController { |
| 30 public: | 32 public: |
| 31 typedef base::Callback<void(scoped_ptr<std::string>)> | 33 typedef base::Callback<void(scoped_ptr<std::string>)> |
| 32 GetTouchDeviceStatusReply; | 34 GetTouchDeviceStatusReply; |
| 35 typedef base::Callback<void(scoped_ptr<std::vector<base::FilePath>>)> |
| 36 GetTouchEventLogReply; |
| 33 | 37 |
| 34 InputController() {} | 38 InputController() {} |
| 35 virtual ~InputController() {} | 39 virtual ~InputController() {} |
| 36 | 40 |
| 37 // Functions for checking devices existence. | 41 // Functions for checking devices existence. |
| 38 virtual bool HasMouse() = 0; | 42 virtual bool HasMouse() = 0; |
| 39 virtual bool HasTouchpad() = 0; | 43 virtual bool HasTouchpad() = 0; |
| 40 | 44 |
| 41 // Keyboard settings. | 45 // Keyboard settings. |
| 42 virtual bool IsCapsLockEnabled() = 0; | 46 virtual bool IsCapsLockEnabled() = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 55 virtual void SetThreeFingerClick(bool enabled) = 0; | 59 virtual void SetThreeFingerClick(bool enabled) = 0; |
| 56 virtual void SetTapDragging(bool enabled) = 0; | 60 virtual void SetTapDragging(bool enabled) = 0; |
| 57 virtual void SetNaturalScroll(bool enabled) = 0; | 61 virtual void SetNaturalScroll(bool enabled) = 0; |
| 58 | 62 |
| 59 // Mouse settings. | 63 // Mouse settings. |
| 60 virtual void SetMouseSensitivity(int value) = 0; | 64 virtual void SetMouseSensitivity(int value) = 0; |
| 61 virtual void SetPrimaryButtonRight(bool right) = 0; | 65 virtual void SetPrimaryButtonRight(bool right) = 0; |
| 62 | 66 |
| 63 // Touch log collection. | 67 // Touch log collection. |
| 64 virtual void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply) = 0; | 68 virtual void GetTouchDeviceStatus(const GetTouchDeviceStatusReply& reply) = 0; |
| 69 virtual void GetTouchEventLog(const base::FilePath& out_dir, |
| 70 const GetTouchEventLogReply& reply) = 0; |
| 65 | 71 |
| 66 // Temporarily enable/disable Tap-to-click. Used to enhance the user | 72 // Temporarily enable/disable Tap-to-click. Used to enhance the user |
| 67 // experience in some use cases (e.g., typing, watching video). | 73 // experience in some use cases (e.g., typing, watching video). |
| 68 virtual void SetTapToClickPaused(bool state) = 0; | 74 virtual void SetTapToClickPaused(bool state) = 0; |
| 69 | 75 |
| 70 // Disables the internal touchpad. | 76 // Disables the internal touchpad. |
| 71 virtual void DisableInternalTouchpad() = 0; | 77 virtual void DisableInternalTouchpad() = 0; |
| 72 | 78 |
| 73 // Enables the internal touchpad. | 79 // Enables the internal touchpad. |
| 74 virtual void EnableInternalTouchpad() = 0; | 80 virtual void EnableInternalTouchpad() = 0; |
| 75 | 81 |
| 76 // Disables all keys on the internal keyboard except |excepted_keys|. | 82 // Disables all keys on the internal keyboard except |excepted_keys|. |
| 77 virtual void DisableInternalKeyboardExceptKeys( | 83 virtual void DisableInternalKeyboardExceptKeys( |
| 78 scoped_ptr<std::set<DomCode>> excepted_keys) = 0; | 84 scoped_ptr<std::set<DomCode>> excepted_keys) = 0; |
| 79 | 85 |
| 80 // Enables all keys on the internal keyboard. | 86 // Enables all keys on the internal keyboard. |
| 81 virtual void EnableInternalKeyboard() = 0; | 87 virtual void EnableInternalKeyboard() = 0; |
| 82 | 88 |
| 83 private: | 89 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(InputController); | 90 DISALLOW_COPY_AND_ASSIGN(InputController); |
| 85 }; | 91 }; |
| 86 | 92 |
| 87 // Create an input controller that does nothing. | 93 // Create an input controller that does nothing. |
| 88 OZONE_EXPORT scoped_ptr<InputController> CreateStubInputController(); | 94 OZONE_EXPORT scoped_ptr<InputController> CreateStubInputController(); |
| 89 | 95 |
| 90 } // namespace ui | 96 } // namespace ui |
| 91 | 97 |
| 92 #endif // UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ | 98 #endif // UI_OZONE_PUBLIC_INPUT_CONTROLLER_H_ |
| OLD | NEW |