| Index: content/browser/renderer_host/render_process_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
|
| index 3471e3c087df2e43716a1bd742defd22d7326c79..6b065927239f147f709dab5723974a490b4883d7 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -1092,6 +1092,28 @@ int RenderProcessHostImpl::VisibleWidgetCount() const {
|
| return visible_widgets_;
|
| }
|
|
|
| +void RenderProcessHostImpl::AudioStopped() {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| +
|
| + // If the backgrounding was skipped because audio was playing, we background
|
| + // the tab.
|
| + if (backgrounded_)
|
| + SetBackgrounded(true);
|
| +}
|
| +
|
| +void RenderProcessHostImpl::AudioStarted() {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| +
|
| + // If audio starts from a backgrounded tab, we un-background it.
|
| + if (backgrounded_) {
|
| + SetBackgrounded(false);
|
| +
|
| + // Since it's not a visible tab, we need to set it to backgrounded so that
|
| + // it is backgrounded again when the video finishes.
|
| + SetBackgrounded(true);
|
| + }
|
| +}
|
| +
|
| bool RenderProcessHostImpl::IsForGuestsOnly() const {
|
| return is_for_guests_only_;
|
| }
|
| @@ -2237,6 +2259,7 @@ void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) {
|
| }
|
|
|
| void RenderProcessHostImpl::SetBackgrounded(bool backgrounded) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| TRACE_EVENT1("renderer_host", "RenderProcessHostImpl::SetBackgrounded",
|
| "backgrounded", backgrounded);
|
| // Note: we always set the backgrounded_ value. If the process is NULL
|
|
|