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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1554233004: Plumb audio muting state to guest web-contents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to WebContentsObserver design. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 1113
1114 if (mute) { 1114 if (mute) {
1115 if (!audio_muter_) 1115 if (!audio_muter_)
1116 audio_muter_.reset(new WebContentsAudioMuter(this)); 1116 audio_muter_.reset(new WebContentsAudioMuter(this));
1117 audio_muter_->StartMuting(); 1117 audio_muter_->StartMuting();
1118 } else { 1118 } else {
1119 DCHECK(audio_muter_); 1119 DCHECK(audio_muter_);
1120 audio_muter_->StopMuting(); 1120 audio_muter_->StopMuting();
1121 } 1121 }
1122 1122
1123 // If we have guests, they should have the same audio muting state.
Charlie Reis 2016/01/06 22:13:51 If we use WebContentsObserver for this, it's gener
wjmaclean 2016/01/06 22:36:09 I included the comment to explain who the (typical
1124 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1125 DidUpdateAudioMutingState(mute));
1126
1123 // Notification for UI updates in response to the changed muting state. 1127 // Notification for UI updates in response to the changed muting state.
1124 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); 1128 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
1125 } 1129 }
1126 1130
1127 bool WebContentsImpl::IsCrashed() const { 1131 bool WebContentsImpl::IsCrashed() const {
1128 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || 1132 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED ||
1129 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || 1133 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
1130 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || 1134 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
1131 #if defined(OS_CHROMEOS) 1135 #if defined(OS_CHROMEOS)
1132 crashed_status_ == 1136 crashed_status_ ==
(...skipping 3588 matching lines...) Expand 10 before | Expand all | Expand 10 after
4721 const WebContentsObserver::MediaPlayerId& id) { 4725 const WebContentsObserver::MediaPlayerId& id) {
4722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); 4726 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id));
4723 } 4727 }
4724 4728
4725 void WebContentsImpl::MediaStoppedPlaying( 4729 void WebContentsImpl::MediaStoppedPlaying(
4726 const WebContentsObserver::MediaPlayerId& id) { 4730 const WebContentsObserver::MediaPlayerId& id) {
4727 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); 4731 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id));
4728 } 4732 }
4729 4733
4730 } // namespace content 4734 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698