Index: ash/common/system/chromeos/palette/eject_controller.cc |
diff --git a/ash/common/system/chromeos/palette/eject_controller.cc b/ash/common/system/chromeos/palette/eject_controller.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bd3d56652af5ad8f5801c76ee76f27a6a124a109 |
--- /dev/null |
+++ b/ash/common/system/chromeos/palette/eject_controller.cc |
@@ -0,0 +1,26 @@ |
+// 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. |
+ |
+#include "ash/common/system/chromeos/palette/eject_controller.h" |
+ |
+#include "ash/common/wm_shell.h" |
+#include "ui/events/devices/input_device_manager.h" |
+ |
+namespace ash { |
+ |
+EjectController::EjectController(const OnEjectCallback& on_eject) |
+ : on_eject_(on_eject) { |
+ ui::InputDeviceManager::GetInstance()->AddObserver(this); |
+} |
+ |
+EjectController::~EjectController() { |
+ ui::InputDeviceManager::GetInstance()->RemoveObserver(this); |
+} |
+ |
+void EjectController::OnStylusEject() { |
+ bool ejected = ui::InputDeviceManager::GetInstance()->StylusEject(); |
stevenjb
2016/08/15 20:18:25
I can't find the CL that introduces StylusEject, b
jdufault
2016/08/15 21:55:04
Done.
|
+ on_eject_.Run(ejected); |
+} |
+ |
+} // namespace ash |