Implement WKPageSetMuted(bool).
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Oct 2014 22:59:15 +0000 (22:59 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Oct 2014 22:59:15 +0000 (22:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138158

Reviewed by Anders Carlsson.

Source/WebCore:

* WebCore.exp.in:
* page/Page.h:

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageSetMuted):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMuted):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setMuted):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175351 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Page.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

index 7ff341a..232e444 100644 (file)
@@ -1,3 +1,13 @@
+2014-10-28  Ada Chan  <adachan@apple.com>
+
+        Implement WKPageSetMuted(bool).
+        https://bugs.webkit.org/show_bug.cgi?id=138158
+
+        Reviewed by Anders Carlsson.
+
+        * WebCore.exp.in:
+        * page/Page.h:
+
 2014-10-29  Alexey Proskuryakov  <ap@apple.com>
 
         Notify Settings object when its Page object goes away.
index 48f8438..37dbada 100644 (file)
@@ -1172,6 +1172,7 @@ __ZN7WebCore4Page36setShouldSuppressScrollbarAnimationsEb
 __ZN7WebCore4Page36suspendActiveDOMObjectsAndAnimationsEv
 __ZN7WebCore4Page37setInLowQualityImageInterpolationModeEb
 __ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE
+__ZN7WebCore4Page8setMutedEb
 __ZN7WebCore4Page9initGroupEv
 __ZN7WebCore4PageC1ERNS0_11PageClientsE
 __ZN7WebCore4PageD1Ev
index c4d3c50..7345504 100644 (file)
@@ -438,7 +438,7 @@ public:
 
     bool isPlayingAudio() const { return m_isPlayingAudio; }
     void updateIsPlayingAudio();
-    void setMuted(bool);
+    WEBCORE_EXPORT void setMuted(bool);
 
 private:
     WEBCORE_EXPORT void initGroup();
index 71c123f..33cd642 100644 (file)
@@ -1,3 +1,21 @@
+2014-10-28  Ada Chan  <adachan@apple.com>
+
+        Implement WKPageSetMuted(bool).
+        https://bugs.webkit.org/show_bug.cgi?id=138158
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetMuted):
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setMuted):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setMuted):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2014-10-29  Anders Carlsson  <andersca@apple.com>
 
         Clear ViewSnapshots when back/forward list items are removed from their list
index adcbdc0..35217e8 100644 (file)
@@ -1806,6 +1806,11 @@ void WKPageSetMediaVolume(WKPageRef page, float volume)
     toImpl(page)->setMediaVolume(volume);    
 }
 
+void WKPageSetMuted(WKPageRef page, bool muted)
+{
+    toImpl(page)->setMuted(muted);
+}
+
 void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
 {
     toImpl(pageRef)->postMessageToInjectedBundle(toImpl(messageNameRef)->string(), toImpl(messageBodyRef));
index 5550b07..edf6961 100644 (file)
@@ -109,6 +109,7 @@ WK_EXPORT bool WKPageGetAddsVisitedLinks(WKPageRef page);
 WK_EXPORT void WKPageSetAddsVisitedLinks(WKPageRef page, bool visitedLinks);
 
 WK_EXPORT bool WKPageIsPlayingAudio(WKPageRef page);
+WK_EXPORT void WKPageSetMuted(WKPageRef page, bool muted);
 
 #ifdef __cplusplus
 }
index 299d277..fe90a1e 100644 (file)
@@ -3383,6 +3383,14 @@ void WebPageProxy::setMediaVolume(float volume)
     m_process->send(Messages::WebPage::SetMediaVolume(volume), m_pageID);    
 }
 
+void WebPageProxy::setMuted(bool muted)
+{
+    if (!isValid())
+        return;
+
+    m_process->send(Messages::WebPage::SetMuted(muted), m_pageID);
+}
+
 void WebPageProxy::setMayStartMediaWhenInWindow(bool mayStartMedia)
 {
     if (mayStartMedia == m_mayStartMediaWhenInWindow)
index 3960283..b94be31 100644 (file)
@@ -837,6 +837,7 @@ public:
     void printMainFrame();
     
     void setMediaVolume(float);
+    void setMuted(bool);
     void setMayStartMediaWhenInWindow(bool);
     bool mayStartMediaWhenInWindow() const { return m_mayStartMediaWhenInWindow; }
         
index 21be105..117d072 100644 (file)
@@ -3914,6 +3914,11 @@ void WebPage::setMediaVolume(float volume)
     m_page->setMediaVolume(volume);
 }
 
+void WebPage::setMuted(bool muted)
+{
+    m_page->setMuted(muted);
+}
+
 void WebPage::setMayStartMediaWhenInWindow(bool mayStartMedia)
 {
     if (mayStartMedia == m_mayStartMediaWhenInWindow)
index 911ed5b..7b530cc 100644 (file)
@@ -701,6 +701,7 @@ public:
     void removeResourceRequest(unsigned long);
 
     void setMediaVolume(float);
+    void setMuted(bool);
     void setMayStartMediaWhenInWindow(bool);
 
     void updateMainFrameScrollOffsetPinning();
index 4878e5d..263e9b8 100644 (file)
@@ -287,6 +287,7 @@ messages -> WebPage LegacyReceiver {
 
     # Media
     SetMediaVolume(float volume)
+    SetMuted(bool muted)
     SetMayStartMediaWhenInWindow(bool mayStartMedia)
 
     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require