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

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

Issue 757033005: Make tab audible and muted states and cause available for an extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better webcontents_impl decoupling Created 5 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 <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 } 942 }
943 943
944 int WebContentsImpl::GetCapturerCount() const { 944 int WebContentsImpl::GetCapturerCount() const {
945 return capturer_count_; 945 return capturer_count_;
946 } 946 }
947 947
948 bool WebContentsImpl::IsAudioMuted() const { 948 bool WebContentsImpl::IsAudioMuted() const {
949 return audio_muter_.get() && audio_muter_->is_muting(); 949 return audio_muter_.get() && audio_muter_->is_muting();
950 } 950 }
951 951
952 void WebContentsImpl::SetAudioMuted(bool mute) { 952 void WebContentsImpl::SetAudioMuted(bool muted) {
953 DVLOG(1) << "SetAudioMuted(mute=" << mute << "), was " << IsAudioMuted() 953 DVLOG(1) << "SetAudioMuted(muted=" << muted
954 << " for WebContentsImpl@" << this; 954 << "), was " << IsAudioMuted() << " for WebContentsImpl@" << this;
955 955
956 if (mute == IsAudioMuted()) 956 if (muted == IsAudioMuted())
957 return; 957 return;
958 958
959 if (mute) { 959 if (muted) {
960 if (!audio_muter_) 960 if (!audio_muter_)
961 audio_muter_.reset(new WebContentsAudioMuter(this)); 961 audio_muter_.reset(new WebContentsAudioMuter(this));
962 audio_muter_->StartMuting(); 962 audio_muter_->StartMuting();
963 } else { 963 } else {
964 DCHECK(audio_muter_); 964 DCHECK(audio_muter_);
965 audio_muter_->StopMuting(); 965 audio_muter_->StopMuting();
966 } 966 }
967 967
968 // Notification for UI updates in response to the changed muting state. 968 // Notification for UI updates in response to the changed muting state.
969 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB); 969 NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
(...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after
4348 node->render_manager()->ResumeResponseDeferredAtStart(); 4348 node->render_manager()->ResumeResponseDeferredAtStart();
4349 } 4349 }
4350 4350
4351 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4351 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4352 force_disable_overscroll_content_ = force_disable; 4352 force_disable_overscroll_content_ = force_disable;
4353 if (view_) 4353 if (view_)
4354 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4354 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4355 } 4355 }
4356 4356
4357 } // namespace content 4357 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698