| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ | 5 #ifndef ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ |
| 6 #define ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ | 6 #define ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "athena/input/public/accelerator_manager.h" | 8 #include "athena/input/public/accelerator_manager.h" |
| 9 #include "athena/input/public/input_manager.h" | 9 #include "athena/input/public/input_manager.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "chromeos/dbus/power_manager_client.h" | 12 #include "chromeos/dbus/power_manager_client.h" |
| 13 | 13 |
| 14 namespace athena { | 14 namespace athena { |
| 15 | 15 |
| 16 class PowerButtonController : public chromeos::PowerManagerClient::Observer, | 16 class PowerButtonController : public chromeos::PowerManagerClient::Observer, |
| 17 public AcceleratorHandler { | 17 public AcceleratorHandler { |
| 18 public: | 18 public: |
| 19 PowerButtonController(); | 19 PowerButtonController(); |
| 20 virtual ~PowerButtonController(); | 20 ~PowerButtonController() override; |
| 21 | 21 |
| 22 void AddPowerButtonObserver(PowerButtonObserver* observer); | 22 void AddPowerButtonObserver(PowerButtonObserver* observer); |
| 23 void RemovePowerButtonObserver(PowerButtonObserver* observer); | 23 void RemovePowerButtonObserver(PowerButtonObserver* observer); |
| 24 | 24 |
| 25 void InstallAccelerators(); | 25 void InstallAccelerators(); |
| 26 | 26 |
| 27 // A timer callabck to notify the long press event. | 27 // A timer callabck to notify the long press event. |
| 28 int SetPowerButtonTimeoutMsForTest(int timeout); | 28 int SetPowerButtonTimeoutMsForTest(int timeout); |
| 29 | 29 |
| 30 private: | 30 private: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 base::TimeTicks zero_brightness_end_time_; | 47 base::TimeTicks zero_brightness_end_time_; |
| 48 bool brightness_is_zero_; | 48 bool brightness_is_zero_; |
| 49 base::OneShotTimer<PowerButtonController> timer_; | 49 base::OneShotTimer<PowerButtonController> timer_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 51 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace athena | 54 } // namespace athena |
| 55 | 55 |
| 56 #endif // ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ | 56 #endif // ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_ |
| OLD | NEW |