Title: [92414] trunk/Source/WebKit/win
Revision
92414
Author
[email protected]
Date
2011-08-04 14:40:42 -0700 (Thu, 04 Aug 2011)

Log Message

Add support for setting and getting whether AVFoundation is enabled to IWebPreferences
https://bugs.webkit.org/show_bug.cgi?id=65718

Reviewed by Adam Roben.

* Interfaces/IWebPreferences.idl: Added setAVFoundationEnabled() and avFoundationEnabled().

* WebPreferenceKeysPrivate.h: Added WebKitAVFoundationEnabledPreferenceKey.

* WebPreferences.cpp:
(WebPreferences::avFoundationEnabled): Added.
(WebPreferences::setAVFoundationEnabled): Added.

* WebPreferences.h: Added setAVFoundationEnabled() and avFoundationEnabled().

* WebView.cpp:
(WebView::notifyPreferencesChanged): Keep settings for AVFoundation being enabled in sync.

Modified Paths

Diff

Modified: trunk/Source/WebKit/win/ChangeLog (92413 => 92414)


--- trunk/Source/WebKit/win/ChangeLog	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/ChangeLog	2011-08-04 21:40:42 UTC (rev 92414)
@@ -1,3 +1,23 @@
+2011-08-04  Jeff Miller  <[email protected]>
+
+        Add support for setting and getting whether AVFoundation is enabled to IWebPreferences
+        https://bugs.webkit.org/show_bug.cgi?id=65718
+
+        Reviewed by Adam Roben.
+
+        * Interfaces/IWebPreferences.idl: Added setAVFoundationEnabled() and avFoundationEnabled().
+
+        * WebPreferenceKeysPrivate.h: Added WebKitAVFoundationEnabledPreferenceKey.
+
+        * WebPreferences.cpp:
+        (WebPreferences::avFoundationEnabled): Added.
+        (WebPreferences::setAVFoundationEnabled): Added.
+
+        * WebPreferences.h: Added setAVFoundationEnabled() and avFoundationEnabled().
+
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged): Keep settings for AVFoundation being enabled in sync.
+
 2011-08-03  Kent Tamura  <[email protected]>
 
         [Windows] Fix build without ENABLE_VIDEO.

Modified: trunk/Source/WebKit/win/Interfaces/IWebPreferences.idl (92413 => 92414)


--- trunk/Source/WebKit/win/Interfaces/IWebPreferences.idl	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/Interfaces/IWebPreferences.idl	2011-08-04 21:40:42 UTC (rev 92414)
@@ -202,4 +202,7 @@
 
     HRESULT pictographFontFamily([out, retval] BSTR* family);
     HRESULT setPictographFontFamily([in] BSTR family);
+
+    HRESULT setAVFoundationEnabled(BOOL avFoundationEnabled);
+    HRESULT avFoundationEnabled(BOOL *avFoundationEnabled);
 }

Modified: trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h (92413 => 92414)


--- trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h	2011-08-04 21:40:42 UTC (rev 92414)
@@ -160,3 +160,4 @@
 
 #define WebKitMediaPlaybackAllowsInlinePreferenceKey "WebKitMediaPlaybackAllowsInline"
 
+#define WebKitAVFoundationEnabledPreferenceKey "WebKitAVFoundationEnabled"

Modified: trunk/Source/WebKit/win/WebPreferences.cpp (92413 => 92414)


--- trunk/Source/WebKit/win/WebPreferences.cpp	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/WebPreferences.cpp	2011-08-04 21:40:42 UTC (rev 92414)
@@ -1612,6 +1612,29 @@
 #endif
 }
 
+HRESULT WebPreferences::avFoundationEnabled(BOOL* enabled)
+{
+#if USE(AVFOUNDATION)
+    if (!enabled)
+        return E_POINTER;
+
+    *enabled = boolValueForKey(CFSTR(WebKitAVFoundationEnabledPreferenceKey));
+    return S_OK;
+#else
+    return E_NOTIMPL;
+#endif
+}
+
+HRESULT WebPreferences::setAVFoundationEnabled(BOOL enabled)
+{
+#if USE(AVFOUNDATION)
+    setBoolValue(CFSTR(WebKitAVFoundationEnabledPreferenceKey), enabled);
+    return S_OK;
+#else
+    return E_NOTIMPL;
+#endif
+}
+
 void WebPreferences::willAddToWebView()
 {
     ++m_numWebViews;

Modified: trunk/Source/WebKit/win/WebPreferences.h (92413 => 92414)


--- trunk/Source/WebKit/win/WebPreferences.h	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/WebPreferences.h	2011-08-04 21:40:42 UTC (rev 92414)
@@ -292,6 +292,12 @@
     virtual HRESULT STDMETHODCALLTYPE shouldPaintCustomScrollbars( 
     /* [retval][out] */ BOOL *shouldPaint);
 
+    virtual HRESULT STDMETHODCALLTYPE setAVFoundationEnabled(
+    /* [in] */ BOOL);
+
+    virtual HRESULT STDMETHODCALLTYPE avFoundationEnabled(
+    /* [retval][out] */ BOOL*);
+
     // IWebPreferencesPrivate
     virtual HRESULT STDMETHODCALLTYPE setDeveloperExtrasEnabled(
         /* [in] */ BOOL);

Modified: trunk/Source/WebKit/win/WebView.cpp (92413 => 92414)


--- trunk/Source/WebKit/win/WebView.cpp	2011-08-04 21:37:03 UTC (rev 92413)
+++ trunk/Source/WebKit/win/WebView.cpp	2011-08-04 21:40:42 UTC (rev 92414)
@@ -4727,6 +4727,13 @@
         return hr;
     settings->setFontRenderingMode(smoothingType != FontSmoothingTypeWindows ? NormalRenderingMode : AlternateRenderingMode);
 
+#if USE(AVFOUNDATION)
+    hr = preferences->avFoundationEnabled(&enabled);
+    if (FAILED(hr))
+        return hr;
+    settings->setAVFoundationEnabled(enabled);
+#endif
+
     COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
     if (prefsPrivate) {
         hr = prefsPrivate->authorAndUserStylesEnabled(&enabled);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to