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

Unified Diff: ash/common/system/chromeos/palette/eject_controller.h

Issue 2234203002: Auto open and close the palette on an eject event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tool-note
Patch Set: Initial upload Created 4 years, 4 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: 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_

Powered by Google App Engine
This is Rietveld 408576698