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

Unified Diff: ash/system/power/tablet_power_button_controller.cc

Issue 2821303004: cros: Suspend media sessions with display off trigger by tablet power button (Closed)
Patch Set: feedback & remove resuming Created 3 years, 7 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/system/power/tablet_power_button_controller.cc
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc
index 7d2fcc9c4b4e449120462abd010cf47885aab433..314eb01eb8fc86bc4b2c01a24dbf64cf0ff2f4fa 100644
--- a/ash/system/power/tablet_power_button_controller.cc
+++ b/ash/system/power/tablet_power_button_controller.cc
@@ -222,6 +222,11 @@ void TabletPowerButtonController::SetDisplayForcedOff(bool forced_off) {
backlights_forced_off_ = forced_off;
UpdateTouchscreenStatus();
+ if (backlights_forced_off_) {
+ ShellDelegate* delegate = Shell::Get()->shell_delegate();
+ delegate->SuspendMediaSessions();
Daniel Erat 2017/05/22 23:38:34 nit: i'd put this on a single line since you only
Qiang(Joe) Xu 2017/05/23 17:54:46 Done.
+ }
+
// Send an a11y alert.
Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
forced_off ? A11Y_ALERT_SCREEN_OFF : A11Y_ALERT_SCREEN_ON);

Powered by Google App Engine
This is Rietveld 408576698