Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Unified Diff: chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h

Issue 2644713002: cros: Use runtime stylus detection for ash palette. (Closed)
Patch Set: Add listeners to options and settings Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h
diff --git a/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h b/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..2bc0ebac9e84ea830c3b62121b323bc966c15002
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/chromeos/device_stylus_handler.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_
+
+#include "base/macros.h"
+#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
+#include "ui/events/devices/input_device_event_observer.h"
+
+namespace base {
+class ListValue;
+}
+
+namespace chromeos {
+namespace settings {
+
+// Chrome OS stylus settings handler.
+class StylusHandler : public ::settings::SettingsPageUIHandler,
+ public ui::InputDeviceEventObserver {
+ public:
+ StylusHandler();
+ ~StylusHandler() override;
+
+ // SettingsPageUIHandler implementation.
+ void RegisterMessages() override;
+ void OnJavascriptAllowed() override;
+ void OnJavascriptDisallowed() override;
+
+ private:
+ // ui::InputDeviceObserver:
+ void OnDeviceListsComplete() override;
+
+ // Called by JS to request a |SendHasStylus| call.
+ void HandleInitialize(const base::ListValue* args);
+
+ // Enables or disables the stylus UI section.
+ void SendHasStylus();
+
+ DISALLOW_COPY_AND_ASSIGN(StylusHandler);
+};
+
+} // namespace settings
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_DEVICE_STYLUS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698