Index: ash/common/system/chromeos/palette/eject_controller.h |
diff --git a/ash/common/system/chromeos/palette/eject_controller.h b/ash/common/system/chromeos/palette/eject_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e6d2983a50a1f04579b2083bbd1349ecb13e5e9 |
--- /dev/null |
+++ b/ash/common/system/chromeos/palette/eject_controller.h |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 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 ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_EJECT_CONTROLLER_H_ |
+#define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_EJECT_CONTROLLER_H_ |
+ |
+#include "ash/ash_export.h" |
+#include "base/callback.h" |
+#include "base/macros.h" |
+#include "ui/events/devices/input_device_event_observer.h" |
+ |
+namespace ash { |
+ |
+// This class observes input device changes for the palette. |
+class ASH_EXPORT EjectController : public ui::InputDeviceEventObserver { |
+ public: |
+ using OnEjectCallback = base::Callback<void(bool)>; |
+ |
+ EjectController(const OnEjectCallback& on_eject); |
+ ~EjectController() override; |
+ |
+ private: |
+ // ui::InputDeviceObserver: |
+ void OnStylusEject() override; |
+ |
+ OnEjectCallback on_eject_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(EjectController); |
+}; |
+ |
+} // namespace ash |
+ |
+#endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_EJECT_CONTROLLER_H_ |