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

Unified Diff: components/guest_view/browser/guest_view_base.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 side-by-side diff with in-line comments
Download patch
Index: components/guest_view/browser/guest_view_base.cc
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
index ff69424ebf5fab389fffe399b3dd465793fd6a0a..fccd0a1c774a6b2ba7ea8f9dbebe138570912905 100644
--- a/components/guest_view/browser/guest_view_base.cc
+++ b/components/guest_view/browser/guest_view_base.cc
@@ -111,6 +111,13 @@ class GuestViewBase::OwnerContentsObserver : public WebContentsObserver {
guest_->web_contents()->SetPageScale(page_scale_factor);
}
+ void DidUpdateAudioMutingState(bool muted) override {
+ if (destroyed_)
+ return;
+
+ guest_->web_contents()->SetAudioMuted(muted);
+ }
+
private:
bool is_fullscreen_;
bool destroyed_;
@@ -401,6 +408,9 @@ void GuestViewBase::DidAttach(int guest_proxy_routing_id) {
SetUpSizing(*attach_params());
+ // The guest should have the same muting state as the owner.
+ web_contents()->SetAudioMuted(owner_web_contents()->IsAudioMuted());
+
// Give the derived class an opportunity to perform some actions.
DidAttachToEmbedder();

Powered by Google App Engine
This is Rietveld 408576698