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

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 9709904ca56a292db2fba3210dee215b7c3dfd9a..c9e7995a1176daf974b2dcb3fcac6171685b7f57 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"
@@ -588,6 +590,13 @@ void ChromeShellDelegate::ToggleTouchpad() {
chromeos::system::InputDeviceSettings::Get()->ToggleTouchpad();
}
+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());
}
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | content/browser/media/session/media_session_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698