OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_STYLUS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| 10 #include "ui/events/devices/input_device_event_observer.h" |
| 11 |
| 12 namespace base { |
| 13 class ListValue; |
| 14 } |
| 15 |
| 16 namespace chromeos { |
| 17 namespace settings { |
| 18 |
| 19 // Chrome OS stylus settings handler. |
| 20 class StylusHandler : public ::settings::SettingsPageUIHandler, |
| 21 public ui::InputDeviceEventObserver { |
| 22 public: |
| 23 StylusHandler(); |
| 24 ~StylusHandler() override; |
| 25 |
| 26 // SettingsPageUIHandler implementation. |
| 27 void RegisterMessages() override; |
| 28 void OnJavascriptAllowed() override; |
| 29 void OnJavascriptDisallowed() override; |
| 30 |
| 31 private: |
| 32 // ui::InputDeviceObserver: |
| 33 void OnDeviceListsComplete() override; |
| 34 |
| 35 // Called by JS to request a |SendHasStylus| call. |
| 36 void HandleInitialize(const base::ListValue* args); |
| 37 |
| 38 // Enables or disables the stylus UI section. |
| 39 void SendHasStylus(); |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(StylusHandler); |
| 42 }; |
| 43 |
| 44 } // namespace settings |
| 45 } // namespace chromeos |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
OLD | NEW |