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 <set> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/chromeos/note_taking_helper.h" |
| 12 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| 13 #include "ui/events/devices/input_device_event_observer.h" |
| 14 |
| 15 namespace base { |
| 16 class ListValue; |
| 17 } |
| 18 |
| 19 namespace chromeos { |
| 20 namespace settings { |
| 21 |
| 22 // Chrome OS stylus settings handler. |
| 23 class StylusHandler : public ::settings::SettingsPageUIHandler, |
| 24 public chromeos::NoteTakingHelper::Observer, |
| 25 public ui::InputDeviceEventObserver { |
| 26 public: |
| 27 StylusHandler(); |
| 28 ~StylusHandler() override; |
| 29 |
| 30 // SettingsPageUIHandler implementation. |
| 31 void RegisterMessages() override; |
| 32 void OnJavascriptAllowed() override {} |
| 33 void OnJavascriptDisallowed() override {} |
| 34 |
| 35 // chromeos::NoteTakingHelper::Observer implementation. |
| 36 void OnAvailableNoteTakingAppsUpdated() override; |
| 37 |
| 38 // ui::InputDeviceObserver: |
| 39 void OnDeviceListsComplete() override; |
| 40 |
| 41 private: |
| 42 void UpdateNoteTakingApps(); |
| 43 void RequestApps(const base::ListValue* unused_args); |
| 44 void SetPreferredNoteTakingApp(const base::ListValue* args); |
| 45 |
| 46 // Called by JS to request a |SendHasStylus| call. |
| 47 void HandleInitialize(const base::ListValue* args); |
| 48 // Enables or disables the stylus UI section. |
| 49 void SendHasStylus(); |
| 50 |
| 51 // IDs of available note-taking apps. |
| 52 std::set<std::string> note_taking_app_ids_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(StylusHandler); |
| 55 }; |
| 56 |
| 57 } // namespace settings |
| 58 } // namespace chromeos |
| 59 |
| 60 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
OLD | NEW |