| 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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const ui::DisplayConfigurator::DisplayStateList& outputs) override; | 73 const ui::DisplayConfigurator::DisplayStateList& outputs) override; |
| 74 | 74 |
| 75 // Overridden from chromeos::PowerManagerClient::Observer: | 75 // Overridden from chromeos::PowerManagerClient::Observer: |
| 76 void PowerButtonEventReceived(bool down, | 76 void PowerButtonEventReceived(bool down, |
| 77 const base::TimeTicks& timestamp) override; | 77 const base::TimeTicks& timestamp) override; |
| 78 #endif | 78 #endif |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 friend class test::PowerButtonControllerTest; | 81 friend class test::PowerButtonControllerTest; |
| 82 | 82 |
| 83 void TakingScreenshot(); |
| 84 |
| 83 // Are the power or lock buttons currently held? | 85 // Are the power or lock buttons currently held? |
| 84 bool power_button_down_; | 86 bool power_button_down_; |
| 85 bool lock_button_down_; | 87 bool lock_button_down_; |
| 86 | 88 |
| 87 // True when the volume down button is being held down. | 89 // True when the volume down button is being held down. |
| 88 bool volume_down_pressed_; | 90 bool volume_down_pressed_; |
| 89 | 91 |
| 92 // Saved everytime the first volume-down is pressed. |
| 93 int first_pressed_volume_percent_; |
| 94 |
| 95 // Used to check if this volume-down is the first. |
| 96 bool volume_down_first_; |
| 97 |
| 90 // Has the screen brightness been reduced to 0%? | 98 // Has the screen brightness been reduced to 0%? |
| 91 bool brightness_is_zero_; | 99 bool brightness_is_zero_; |
| 92 | 100 |
| 93 // True if an internal display is off while an external display is on (e.g. | 101 // True if an internal display is off while an external display is on (e.g. |
| 94 // for Chrome OS's docked mode, where a Chromebook's lid is closed while an | 102 // for Chrome OS's docked mode, where a Chromebook's lid is closed while an |
| 95 // external display is connected). | 103 // external display is connected). |
| 96 bool internal_display_off_and_external_display_on_; | 104 bool internal_display_off_and_external_display_on_; |
| 97 | 105 |
| 98 // Was a command-line switch set telling us that we're running on hardware | 106 // Was a command-line switch set telling us that we're running on hardware |
| 99 // that misreports power button releases? | 107 // that misreports power button releases? |
| 100 bool has_legacy_power_button_; | 108 bool has_legacy_power_button_; |
| 101 | 109 |
| 102 // Enables quick, non-cancellable locking of the screen when in maximize mode. | 110 // Enables quick, non-cancellable locking of the screen when in maximize mode. |
| 103 bool enable_quick_lock_; | 111 bool enable_quick_lock_; |
| 104 | 112 |
| 105 LockStateController* controller_; // Not owned. | 113 LockStateController* controller_; // Not owned. |
| 106 | 114 |
| 107 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 115 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
| 108 }; | 116 }; |
| 109 | 117 |
| 110 } // namespace ash | 118 } // namespace ash |
| 111 | 119 |
| 112 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 120 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
| OLD | NEW |