Index: content/browser/web_contents/web_contents_impl.cc |
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
index 350f586d8dcd797d337b9559cf1ffad54f483f21..d6c3c3c216cb04a0c28df0aeb55ed6f2cc0e77c2 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -3004,15 +3004,15 @@ void WebContentsImpl::OnUpdateFaviconURL( |
void WebContentsImpl::OnMediaPlayingNotification(int64 player_cookie, |
bool has_video, |
bool has_audio) { |
-#if !defined(OS_CHROMEOS) |
+ // Power save blocking is controlled by the tab audio indicator on desktop |
+ // platforms. |
+#if !defined(OS_CHROMEOS) && defined(OS_ANDROID) |
scoped_ptr<PowerSaveBlocker> blocker; |
if (has_video) { |
blocker = PowerSaveBlocker::Create( |
PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep, "Playing video"); |
scherkus (not reviewing)
2014/08/21 21:42:55
FYI this is prevent display sleep
|
-#if defined(OS_ANDROID) |
static_cast<PowerSaveBlockerImpl*>(blocker.get()) |
->InitDisplaySleepBlocker(GetView()->GetNativeView()); |
-#endif |
} else if (has_audio) { |
blocker = PowerSaveBlocker::Create( |
PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, "Playing audio"); |
scherkus (not reviewing)
2014/08/21 21:42:55
FYI this is the audio-only branch which only preve
miu
2014/08/25 19:34:52
note: It should be perfectly safe to have multiple
|