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

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

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.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

Powered by Google App Engine
This is Rietveld 408576698