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

Side by Side Diff: athena/input/power_button_controller.h

Issue 863033002: Delete athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « athena/input/input_manager_unittest.cc ('k') | athena/input/power_button_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_
6 #define ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_
7
8 #include "athena/input/public/accelerator_manager.h"
9 #include "athena/input/public/input_manager.h"
10 #include "base/observer_list.h"
11 #include "base/timer/timer.h"
12 #include "chromeos/dbus/power_manager_client.h"
13
14 namespace athena {
15
16 class PowerButtonController : public chromeos::PowerManagerClient::Observer,
17 public AcceleratorHandler {
18 public:
19 PowerButtonController();
20 ~PowerButtonController() override;
21
22 void AddPowerButtonObserver(PowerButtonObserver* observer);
23 void RemovePowerButtonObserver(PowerButtonObserver* observer);
24
25 void InstallAccelerators();
26
27 // A timer callabck to notify the long press event.
28 int SetPowerButtonTimeoutMsForTest(int timeout);
29
30 private:
31 // chromeos::PowerManagerClient::Observer:
32 virtual void BrightnessChanged(int level, bool user_initiated) override;
33 virtual void PowerButtonEventReceived(
34 bool down,
35 const base::TimeTicks& timestamp) override;
36
37 // AcceleratorHandler:
38 virtual bool IsCommandEnabled(int command_id) const override;
39 virtual bool OnAcceleratorFired(int command_id,
40 const ui::Accelerator& accelerator) override;
41
42 void NotifyLongPress();
43
44 int power_button_timeout_ms_;
45 ObserverList<PowerButtonObserver> observers_;
46 // The last time at which the screen brightness was 0%.
47 base::TimeTicks zero_brightness_end_time_;
48 bool brightness_is_zero_;
49 base::OneShotTimer<PowerButtonController> timer_;
50
51 DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
52 };
53
54 } // namespace athena
55
56 #endif // ATHENA_INPUT_POWER_BUTTON_CONTROLLER_H_
OLDNEW
« no previous file with comments | « athena/input/input_manager_unittest.cc ('k') | athena/input/power_button_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698