Chromium Code Reviews| 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..5507065a1cfc8d28359a2fec2b012185939f8570 |
| --- /dev/null |
| +++ b/ash/common/system/chromeos/palette/eject_controller.h |
| @@ -0,0 +1,35 @@ |
| +// 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" |
| +#include "ui/events/devices/input_device_manager.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(ui::StylusState)>; |
| + |
| + EjectController(const OnEjectCallback& on_eject); |
|
oshima
2016/08/24 23:38:50
nit: explicit
jdufault
2016/08/24 23:54:07
Done.
|
| + ~EjectController() override; |
| + |
| + private: |
| + // ui::InputDeviceObserver: |
| + void OnStylusStateChanged(ui::StylusState state) override; |
| + |
| + OnEjectCallback on_eject_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(EjectController); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_EJECT_CONTROLLER_H_ |