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

Unified Diff: ash/common/wm/maximize_mode/maximize_mode_controller.cc

Issue 2768543002: chromeos: Add PowerManagerClient::GetSwitchStates(). (Closed)
Patch Set: document that callbacks aren't run on error Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ash/common/wm/maximize_mode/maximize_mode_controller.cc
diff --git a/ash/common/wm/maximize_mode/maximize_mode_controller.cc b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
index 04b2a3c43f6a7bb1b49b31cac57264a19a062f40..173de0c1960d831f98ff08df6f1732bce3003b09 100644
--- a/ash/common/wm/maximize_mode/maximize_mode_controller.cc
+++ b/ash/common/wm/maximize_mode/maximize_mode_controller.cc
@@ -206,8 +206,10 @@ void MaximizeModeController::OnAccelerometerUpdated(
}
}
-void MaximizeModeController::LidEventReceived(bool open,
- const base::TimeTicks& time) {
+void MaximizeModeController::LidEventReceived(
+ chromeos::PowerManagerClient::LidState state,
+ const base::TimeTicks& time) {
+ const bool open = state == chromeos::PowerManagerClient::LidState::OPEN;
if (open)
last_lid_open_time_ = time;
lid_is_closed_ = !open;
@@ -215,8 +217,9 @@ void MaximizeModeController::LidEventReceived(bool open,
}
void MaximizeModeController::TabletModeEventReceived(
- bool on,
+ chromeos::PowerManagerClient::TabletMode mode,
const base::TimeTicks& time) {
+ const bool on = mode == chromeos::PowerManagerClient::TabletMode::ON;
tablet_mode_switch_is_on_ = on;
// Do not change if docked.
if (!display::Display::HasInternalDisplay() ||
« no previous file with comments | « ash/common/wm/maximize_mode/maximize_mode_controller.h ('k') | ash/wm/maximize_mode/maximize_mode_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698