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

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: Address comments. 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 <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 1121
1122 if (mute) { 1122 if (mute) {
1123 if (!audio_muter_) 1123 if (!audio_muter_)
1124 audio_muter_.reset(new WebContentsAudioMuter(this)); 1124 audio_muter_.reset(new WebContentsAudioMuter(this));
1125 audio_muter_->StartMuting(); 1125 audio_muter_->StartMuting();
1126 } else { 1126 } else {
1127 DCHECK(audio_muter_); 1127 DCHECK(audio_muter_);
1128 audio_muter_->StopMuting(); 1128 audio_muter_->StopMuting();
1129 } 1129 }
1130 1130
1131 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1132 DidUpdateAudioMutingState(mute));
1133
1131 // Notification for UI updates in response to the changed muting state. 1134 // Notification for UI updates in response to the changed muting state.
1132 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); 1135 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
1133 } 1136 }
1134 1137
1135 bool WebContentsImpl::IsCrashed() const { 1138 bool WebContentsImpl::IsCrashed() const {
1136 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED || 1139 return (crashed_status_ == base::TERMINATION_STATUS_PROCESS_CRASHED ||
1137 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION || 1140 crashed_status_ == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
1138 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || 1141 crashed_status_ == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
1139 #if defined(OS_CHROMEOS) 1142 #if defined(OS_CHROMEOS)
1140 crashed_status_ == 1143 crashed_status_ ==
(...skipping 3595 matching lines...) Expand 10 before | Expand all | Expand 10 after
4736 const WebContentsObserver::MediaPlayerId& id) { 4739 const WebContentsObserver::MediaPlayerId& id) {
4737 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); 4740 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id));
4738 } 4741 }
4739 4742
4740 void WebContentsImpl::MediaStoppedPlaying( 4743 void WebContentsImpl::MediaStoppedPlaying(
4741 const WebContentsObserver::MediaPlayerId& id) { 4744 const WebContentsObserver::MediaPlayerId& id) {
4742 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); 4745 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id));
4743 } 4746 }
4744 4747
4745 } // namespace content 4748 } // namespace content
OLDNEW
« no previous file with comments | « components/guest_view/browser/guest_view_base.cc ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698