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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 2821303004: cros: Suspend media sessions with display off trigger by tablet power button (Closed)
Patch Set: rebase 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: chrome/browser/ui/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index b550ad2e967d17fd79e488c9f81b614caf89f402..bd98e2c1dd82d8748e03fa7f04eaa04a70c9f6ac 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -60,6 +60,7 @@
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -68,6 +69,7 @@
#include "components/prefs/pref_service.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
+#include "content/public/browser/media_session.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/service_manager_connection.h"
#include "ui/aura/window.h"
@@ -590,6 +592,20 @@ void ChromeShellDelegate::ToggleTouchpad() {
chromeos::system::InputDeviceSettings::Get()->ToggleTouchpad();
}
+void ChromeShellDelegate::ResumeMediaSessions() {
+ for (TabContentsIterator it; !it.done(); it.Next()) {
+ content::MediaSession::Get(*it)->Resume(
+ content::MediaSession::SuspendType::SYSTEM);
Daniel Erat 2017/05/17 01:22:25 is SYSTEM actually an appropriate type to use here
mlamouri (slow - plz ping) 2017/05/17 12:52:26 System sounds like the right thing to do here. The
Qiang(Joe) Xu 2017/05/22 22:58:47 mlamouri@, since we are not actually entering susp
+ }
+}
+
+void ChromeShellDelegate::SuspendMediaSessions() {
+ for (TabContentsIterator it; !it.done(); it.Next()) {
+ content::MediaSession::Get(*it)->Suspend(
+ content::MediaSession::SuspendType::SYSTEM);
+ }
+}
+
keyboard::KeyboardUI* ChromeShellDelegate::CreateKeyboardUI() {
return new ChromeKeyboardUI(ProfileManager::GetActiveUserProfile());
}

Powered by Google App Engine
This is Rietveld 408576698