| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/chromeos/note_taking_helper.h" | 11 #include "chrome/browser/chromeos/note_taking_helper.h" |
| 12 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.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 } |
| 13 | 18 |
| 14 namespace chromeos { | 19 namespace chromeos { |
| 15 namespace settings { | 20 namespace settings { |
| 16 | 21 |
| 22 // Chrome OS stylus settings handler. |
| 17 class StylusHandler : public ::settings::SettingsPageUIHandler, | 23 class StylusHandler : public ::settings::SettingsPageUIHandler, |
| 18 public chromeos::NoteTakingHelper::Observer { | 24 public chromeos::NoteTakingHelper::Observer, |
| 25 public ui::InputDeviceEventObserver { |
| 19 public: | 26 public: |
| 20 StylusHandler(); | 27 StylusHandler(); |
| 21 ~StylusHandler() override; | 28 ~StylusHandler() override; |
| 22 | 29 |
| 23 // SettingsPageUIHandler implementation. | 30 // SettingsPageUIHandler implementation. |
| 24 void RegisterMessages() override; | 31 void RegisterMessages() override; |
| 25 void OnJavascriptAllowed() override {} | 32 void OnJavascriptAllowed() override {} |
| 26 void OnJavascriptDisallowed() override {} | 33 void OnJavascriptDisallowed() override {} |
| 27 | 34 |
| 28 // chromeos::NoteTakingHelper::Observer implementation. | 35 // chromeos::NoteTakingHelper::Observer implementation. |
| 29 void OnAvailableNoteTakingAppsUpdated() override; | 36 void OnAvailableNoteTakingAppsUpdated() override; |
| 30 | 37 |
| 38 // ui::InputDeviceObserver: |
| 39 void OnDeviceListsComplete() override; |
| 40 |
| 31 private: | 41 private: |
| 32 void UpdateNoteTakingApps(); | 42 void UpdateNoteTakingApps(); |
| 33 void RequestApps(const base::ListValue* unused_args); | 43 void RequestApps(const base::ListValue* unused_args); |
| 34 void SetPreferredNoteTakingApp(const base::ListValue* args); | 44 void SetPreferredNoteTakingApp(const base::ListValue* args); |
| 35 | 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 |
| 36 // IDs of available note-taking apps. | 51 // IDs of available note-taking apps. |
| 37 std::set<std::string> note_taking_app_ids_; | 52 std::set<std::string> note_taking_app_ids_; |
| 38 | 53 |
| 39 DISALLOW_COPY_AND_ASSIGN(StylusHandler); | 54 DISALLOW_COPY_AND_ASSIGN(StylusHandler); |
| 40 }; | 55 }; |
| 41 | 56 |
| 42 } // namespace settings | 57 } // namespace settings |
| 43 } // namespace chromeos | 58 } // namespace chromeos |
| 44 | 59 |
| 45 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ | 60 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_ |
| OLD | NEW |