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

Side by Side Diff: ash/system/chromeos/power/tablet_power_button_controller.h

Issue 2664683002: ash: Drop the immediately following power button released induced forcing off request (Closed)
Patch Set: better comments Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SYSTEM_CHROMEOS_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ 5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_
6 #define ASH_SYSTEM_CHROMEOS_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ 6 #define ASH_SYSTEM_CHROMEOS_POWER_TABLET_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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // True if the screen was off when the power button was pressed. 110 // True if the screen was off when the power button was pressed.
111 bool screen_off_when_power_button_down_ = false; 111 bool screen_off_when_power_button_down_ = false;
112 112
113 // Time source for performed action times. 113 // Time source for performed action times.
114 std::unique_ptr<base::TickClock> tick_clock_; 114 std::unique_ptr<base::TickClock> tick_clock_;
115 115
116 // Saves the most recent timestamp that powerd is resuming from suspend, 116 // Saves the most recent timestamp that powerd is resuming from suspend,
117 // updated in SuspendDone(). 117 // updated in SuspendDone().
118 base::TimeTicks last_resume_time_; 118 base::TimeTicks last_resume_time_;
119 119
120 // Saves the most recent timestamp that power button is released.
121 base::TimeTicks last_released_time_;
Daniel Erat 2017/01/30 17:55:00 last_button_up_time_ or last_power_button_up_time_
Daniel Erat 2017/01/30 17:55:00 last_button_up_time_ or last_power_button_up_time_
Qiang(Joe) Xu 2017/01/30 19:35:44 Changed to last_button_up_time_ to match force_off
122
120 // True if power button released should force off display. 123 // True if power button released should force off display.
121 bool force_off_on_button_up_; 124 bool force_off_on_button_up_;
122 125
123 // Started when the tablet power button is pressed and stopped when it's 126 // Started when the tablet power button is pressed and stopped when it's
124 // released. Runs OnShutdownTimeout() to start shutdown. 127 // released. Runs OnShutdownTimeout() to start shutdown.
125 base::OneShotTimer shutdown_timer_; 128 base::OneShotTimer shutdown_timer_;
126 129
127 LockStateController* controller_; // Not owned. 130 LockStateController* controller_; // Not owned.
128 131
129 base::WeakPtrFactory<TabletPowerButtonController> weak_ptr_factory_; 132 base::WeakPtrFactory<TabletPowerButtonController> weak_ptr_factory_;
130 133
131 DISALLOW_COPY_AND_ASSIGN(TabletPowerButtonController); 134 DISALLOW_COPY_AND_ASSIGN(TabletPowerButtonController);
132 }; 135 };
133 136
134 } // namespace ash 137 } // namespace ash
135 138
136 #endif // ASH_SYSTEM_CHROMEOS_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ 139 #endif // ASH_SYSTEM_CHROMEOS_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698