| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_POINTER_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_POINTER_HANDLER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/chromeos/system/pointer_device_observer.h" |
| 12 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| 13 |
| 14 namespace base { |
| 15 class ListValue; |
| 16 } |
| 17 |
| 18 namespace chromeos { |
| 19 namespace settings { |
| 20 |
| 21 // Chrome OS "Mouse and touchpad" settings page UI handler. |
| 22 class PointerHandler |
| 23 : public ::settings::SettingsPageUIHandler, |
| 24 public chromeos::system::PointerDeviceObserver::Observer { |
| 25 public: |
| 26 PointerHandler(); |
| 27 ~PointerHandler() override; |
| 28 |
| 29 // SettingsPageUIHandler implementation. |
| 30 void RegisterMessages() override; |
| 31 void OnJavascriptAllowed() override; |
| 32 void OnJavascriptDisallowed() override; |
| 33 |
| 34 private: |
| 35 // PointerDeviceObserver implementation. |
| 36 void TouchpadExists(bool exists) override; |
| 37 void MouseExists(bool exists) override; |
| 38 |
| 39 // Initializes the page with the current pointer information. |
| 40 void HandleInitialize(const base::ListValue* args); |
| 41 |
| 42 std::unique_ptr<chromeos::system::PointerDeviceObserver> |
| 43 pointer_device_observer_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(PointerHandler); |
| 46 }; |
| 47 |
| 48 } // namespace settings |
| 49 } // namespace chromeos |
| 50 |
| 51 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_POINTER_HANDLER_H_ |
| OLD | NEW |