OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 5 #ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 void OnKeyEvent(ui::KeyEvent* event) override; | 45 void OnKeyEvent(ui::KeyEvent* event) override; |
46 | 46 |
47 // Overriden from display::DisplayConfigurator::Observer: | 47 // Overriden from display::DisplayConfigurator::Observer: |
48 void OnDisplayModeChanged( | 48 void OnDisplayModeChanged( |
49 const display::DisplayConfigurator::DisplayStateList& outputs) override; | 49 const display::DisplayConfigurator::DisplayStateList& outputs) override; |
50 | 50 |
51 // Overridden from chromeos::PowerManagerClient::Observer: | 51 // Overridden from chromeos::PowerManagerClient::Observer: |
52 void PowerButtonEventReceived(bool down, | 52 void PowerButtonEventReceived(bool down, |
53 const base::TimeTicks& timestamp) override; | 53 const base::TimeTicks& timestamp) override; |
54 | 54 |
| 55 // Resets |tablet_controller_| to hold a new object to simulate Chrome |
| 56 // starting. |
| 57 void ResetTabletPowerButtonControllerForTest(); |
| 58 |
55 TabletPowerButtonController* tablet_power_button_controller_for_test() { | 59 TabletPowerButtonController* tablet_power_button_controller_for_test() { |
56 return tablet_controller_.get(); | 60 return tablet_controller_.get(); |
57 } | 61 } |
58 | 62 |
59 private: | 63 private: |
60 // Are the power or lock buttons currently held? | 64 // Are the power or lock buttons currently held? |
61 bool power_button_down_; | 65 bool power_button_down_; |
62 bool lock_button_down_; | 66 bool lock_button_down_; |
63 | 67 |
64 // True when the volume down button is being held down. | 68 // True when the volume down button is being held down. |
(...skipping 19 matching lines...) Expand all Loading... |
84 | 88 |
85 // Handles events for convertible/tablet devices. | 89 // Handles events for convertible/tablet devices. |
86 std::unique_ptr<TabletPowerButtonController> tablet_controller_; | 90 std::unique_ptr<TabletPowerButtonController> tablet_controller_; |
87 | 91 |
88 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 92 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
89 }; | 93 }; |
90 | 94 |
91 } // namespace ash | 95 } // namespace ash |
92 | 96 |
93 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 97 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
OLD | NEW |