Changeset 101977 in webkit


Ignore:
Timestamp:
Dec 5, 2011, 12:42:27 AM (14 years ago)
Author:
eric.carlson@apple.com
Message:

Source/WebCore: WebCore part of: Add WebKit preferences for text track settings
https://bugs.webkit.org/show_bug.cgi?id=73721

Reviewed by John Sullivan.

No new tests yet, still nothing to test.

  • page/Settings.cpp:

(WebCore::Settings::setShouldDisplaySubtitles): Move the setters to the .cpp file so they

aren't inlined.

(WebCore::Settings::setShouldDisplayCaptions): Ditto.
(WebCore::Settings::setShouldDisplayTextDescriptions): Ditto.

  • page/Settings.h:

Source/WebKit/chromium: WebKit/chromium part of: Add WebKit preferences for text track settings
https://bugs.webkit.org/show_bug.cgi?id=73721

Reviewed by John Sullivan.

  • src/WebSettingsImpl.cpp:

(WebKit::WebSettingsImpl::shouldDisplaySubtitles): Added.
(WebKit::WebSettingsImpl::shouldDisplayCaptions): Ditto.
(WebKit::WebSettingsImpl::shouldDisplayTextDescriptions): Ditto.

  • src/WebSettingsImpl.h:

Source/WebKit/mac: Add WebKit preferences for text track settings
https://bugs.webkit.org/show_bug.cgi?id=73721

Reviewed by John Sullivan.

  • WebView/WebPreferenceKeysPrivate.h: Added #define for shouldDisplaySubtitles, shouldDisplayCaptions,

and shouldDisplayTextDescriptions properties.

  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]): Initialize new preferences to NO.
(-[WebPreferences setShouldDisplaySubtitles:]): Added.
(-[WebPreferences shouldDisplaySubtitles]): Ditto.
(-[WebPreferences setShouldDisplayCaptions:]): Ditto.
(-[WebPreferences shouldDisplayCaptions]): Ditto.
(-[WebPreferences setShouldDisplayTextDescriptions:]): Ditto.
(-[WebPreferences shouldDisplayTextDescriptions]): Ditto.

  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]): Updates WebCore settings from WebKit prefs.

Source/WebKit/win: WebKit/mac part of: Add WebKit preferences for text track settings
https://bugs.webkit.org/show_bug.cgi?id=73721

Reviewed by John Sullivan.

  • Interfaces/IWebPreferences.idl: Declare getters and setters for new properties.
  • WebPreferenceKeysPrivate.h: Added #define for shouldDisplaySubtitles, shouldDisplayCaptions,

and shouldDisplayTextDescriptions properties.

  • WebPreferences.cpp:

(WebPreferences::setShouldDisplaySubtitles): Added.
(WebPreferences::shouldDisplaySubtitles): Ditto.
(WebPreferences::setShouldDisplayCaptions): Ditto.
(WebPreferences::shouldDisplayCaptions): Ditto.
(WebPreferences::setShouldDisplayTextDescriptions): Ditto.
(WebPreferences::shouldDisplayTextDescriptions): Ditto.

  • WebPreferences.h: Declare new methods.
  • WebView.cpp:

(WebView::notifyPreferencesChanged): Updates WebCore settings from WebKit prefs.

Source/WebKit2: WebKit2 part of: Add WebKit preferences for text track settings
https://bugs.webkit.org/show_bug.cgi?id=73721

Reviewed by John Sullivan.

  • Shared/WebPreferencesStore.h: Declared shouldDisplaySubtitles, shouldDisplayCaptions, and

shouldDisplayTextDescriptions properties with macros. All default to false.

  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetShouldDisplaySubtitles): Added.
(WKPreferencesGetShouldDisplaySubtitles): Ditto.
(WKPreferencesSetShouldDisplayCaptions): Ditto.
(WKPreferencesGetShouldDisplayCaptions): Ditto.
(WKPreferencesSetShouldDisplayTextDescriptions): Ditto.
(WKPreferencesGetShouldDisplayTextDescriptions): Ditto.

  • UIProcess/API/C/WKPreferences.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences): Updates WebCore settings from WebKit2 prefs.

Location:
trunk/Source
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r101975 r101977  
     12011-12-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        WebCore part of: Add WebKit preferences for text track settings
     4        https://bugs.webkit.org/show_bug.cgi?id=73721
     5
     6        Reviewed by John Sullivan.
     7
     8        No new tests yet, still nothing to test.
     9
     10        * page/Settings.cpp:
     11        (WebCore::Settings::setShouldDisplaySubtitles): Move the setters to the .cpp file so they
     12            aren't inlined.
     13        (WebCore::Settings::setShouldDisplayCaptions): Ditto.
     14        (WebCore::Settings::setShouldDisplayTextDescriptions): Ditto.
     15        * page/Settings.h:
     16
    1172011-12-05  Noel Gordon  <noel.gordon@gmail.com>
    218
  • trunk/Source/WebCore/page/Settings.cpp

    r101674 r101977  
    837837}
    838838
     839#if ENABLE(VIDEO_TRACK)
     840void Settings::setShouldDisplaySubtitles(bool flag)
     841{
     842    m_shouldDisplaySubtitles = flag;
     843}
     844
     845void Settings::setShouldDisplayCaptions(bool flag)
     846{
     847    m_shouldDisplayCaptions = flag;
     848}
     849
     850void Settings::setShouldDisplayTextDescriptions(bool flag)
     851{
     852    m_shouldDisplayTextDescriptions = flag;
     853}
     854#endif
     855
    839856} // namespace WebCore
  • trunk/Source/WebCore/page/Settings.h

    r101674 r101977  
    488488
    489489#if ENABLE(VIDEO_TRACK)
    490         void setShouldDisplaySubtitles(bool flag) { m_shouldDisplaySubtitles = flag; }
     490        void setShouldDisplaySubtitles(bool);
    491491        bool shouldDisplaySubtitles() const { return m_shouldDisplaySubtitles; }
    492492
    493         void setShouldDisplayCaptions(bool flag) { m_shouldDisplayCaptions = flag; }
     493        void setShouldDisplayCaptions(bool);
    494494        bool shouldDisplayCaptions() const { return m_shouldDisplayCaptions; }
    495495
    496         void setShouldDisplayTextDescriptions(bool flag) { m_shouldDisplayTextDescriptions = flag; }
     496        void setShouldDisplayTextDescriptions(bool);
    497497        bool shouldDisplayTextDescriptions() const { return m_shouldDisplayTextDescriptions; }
    498498#endif
  • trunk/Source/WebKit/chromium/ChangeLog

    r101969 r101977  
     12011-12-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        WebKit/chromium part of: Add WebKit preferences for text track settings
     4        https://bugs.webkit.org/show_bug.cgi?id=73721
     5
     6        Reviewed by John Sullivan.
     7
     8        * src/WebSettingsImpl.cpp:
     9        (WebKit::WebSettingsImpl::shouldDisplaySubtitles): Added.
     10        (WebKit::WebSettingsImpl::shouldDisplayCaptions): Ditto.
     11        (WebKit::WebSettingsImpl::shouldDisplayTextDescriptions): Ditto.
     12        * src/WebSettingsImpl.h:
     13
    1142011-12-04  Sheriff Bot  <webkit.review.bot@gmail.com>
    215
  • trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp

    r101576 r101977  
    466466}
    467467
     468void WebSettingsImpl::setShouldDisplaySubtitles(bool enabled)
     469{
     470#if ENABLE(VIDEO_TRACK)
     471    m_settings->setShouldDisplaySubtitles(enabled);
     472#else
     473    UNUSED_PARAM(enabled);
     474#endif
     475}
     476
     477void WebSettingsImpl::setShouldDisplayCaptions(bool enabled)
     478{
     479#if ENABLE(VIDEO_TRACK)
     480    m_settings->setShouldDisplayCaptions(enabled);
     481#else
     482    UNUSED_PARAM(enabled);
     483#endif
     484}
     485
     486void WebSettingsImpl::setShouldDisplayTextDescriptions(bool enabled)
     487{
     488#if ENABLE(VIDEO_TRACK)
     489    m_settings->setShouldDisplayTextDescriptions(enabled);
     490#else
     491    UNUSED_PARAM(enabled);
     492#endif
     493}
     494
     495
    468496} // namespace WebKit
  • trunk/Source/WebKit/chromium/src/WebSettingsImpl.h

    r101576 r101977  
    125125    virtual void setHixie76WebSocketProtocolEnabled(bool);
    126126    virtual void setVisualWordMovementEnabled(bool);
     127    virtual void setShouldDisplaySubtitles(bool);
     128    virtual void setShouldDisplayCaptions(bool);
     129    virtual void setShouldDisplayTextDescriptions(bool);
    127130
    128131private:
  • trunk/Source/WebKit/mac/ChangeLog

    r101939 r101977  
     12011-12-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Add WebKit preferences for text track settings
     4        https://bugs.webkit.org/show_bug.cgi?id=73721
     5
     6        Reviewed by John Sullivan.
     7
     8        * WebView/WebPreferenceKeysPrivate.h: Added #define for shouldDisplaySubtitles, shouldDisplayCaptions,
     9        and shouldDisplayTextDescriptions properties.
     10
     11        * WebView/WebPreferences.mm:
     12        (+[WebPreferences initialize]): Initialize new preferences to NO.
     13        (-[WebPreferences setShouldDisplaySubtitles:]): Added.
     14        (-[WebPreferences shouldDisplaySubtitles]): Ditto.
     15        (-[WebPreferences setShouldDisplayCaptions:]): Ditto.
     16        (-[WebPreferences shouldDisplayCaptions]): Ditto.
     17        (-[WebPreferences setShouldDisplayTextDescriptions:]): Ditto.
     18        (-[WebPreferences shouldDisplayTextDescriptions]): Ditto.
     19        * WebView/WebPreferencesPrivate.h:
     20
     21        * WebView/WebView.mm:
     22        (-[WebView _preferencesChanged:]): Updates WebCore settings from WebKit prefs.
     23
    1242011-12-03  Dan Bernstein  <mitz@apple.com>
    225
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r98769 r101977  
    112112#define WebKitMediaPlaybackAllowsInlinePreferenceKey @"WebKitMediaPlaybackAllowsInline"
    113113#define WebKitMockScrollbarsEnabledPreferenceKey @"WebKitMockScrollbarsEnabled"
     114#define WebKitShouldDisplaySubtitlesPreferenceKey @"WebKitShouldDisplaySubtitles"
     115#define WebKitShouldDisplayCaptionsPreferenceKey @"WebKitShouldDisplayCaptions"
     116#define WebKitShouldDisplayTextDescriptionsPreferenceKey @"WebKitShouldDisplayTextDescriptions"
    114117
    115118// These are private both because callers should be using the cover methods and because the
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r98769 r101977  
    388388        [NSNumber numberWithBool:NO],   WebKitSuppressIncrementalRenderingKey,
    389389        [NSNumber numberWithBool:YES],  WebKitBackspaceKeyNavigationEnabledKey,
     390        [NSNumber numberWithBool:NO],   WebKitShouldDisplaySubtitlesPreferenceKey,
     391        [NSNumber numberWithBool:NO],   WebKitShouldDisplayCaptionsPreferenceKey,
     392        [NSNumber numberWithBool:NO],   WebKitShouldDisplayTextDescriptionsPreferenceKey,
    390393
    391394        [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
     
    15751578}
    15761579
     1580- (void)setShouldDisplaySubtitles:(BOOL)flag
     1581{
     1582    [self _setBoolValue:flag forKey:WebKitShouldDisplaySubtitlesPreferenceKey];
     1583}
     1584
     1585- (BOOL)shouldDisplaySubtitles
     1586{
     1587    return [self _boolValueForKey:WebKitShouldDisplaySubtitlesPreferenceKey];
     1588}
     1589
     1590- (void)setShouldDisplayCaptions:(BOOL)flag
     1591{
     1592    [self _setBoolValue:flag forKey:WebKitShouldDisplayCaptionsPreferenceKey];
     1593}
     1594
     1595- (BOOL)shouldDisplayCaptions
     1596{
     1597    return [self _boolValueForKey:WebKitShouldDisplayCaptionsPreferenceKey];
     1598}
     1599
     1600- (void)setShouldDisplayTextDescriptions:(BOOL)flag
     1601{
     1602    [self _setBoolValue:flag forKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
     1603}
     1604
     1605- (BOOL)shouldDisplayTextDescriptions
     1606{
     1607    return [self _boolValueForKey:WebKitShouldDisplayTextDescriptionsPreferenceKey];
     1608}
     1609
    15771610@end
    15781611
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r98769 r101977  
    272272- (BOOL)backspaceKeyNavigationEnabled;
    273273
     274- (void)setShouldDisplaySubtitles:(BOOL)flag;
     275- (BOOL)shouldDisplaySubtitles;
     276
     277- (void)setShouldDisplayCaptions:(BOOL)flag;
     278- (BOOL)shouldDisplayCaptions;
     279
     280- (void)setShouldDisplayTextDescriptions:(BOOL)flag;
     281- (BOOL)shouldDisplayTextDescriptions;
     282
    274283@end
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r101939 r101977  
    14971497    settings->setBackspaceKeyNavigationEnabled([preferences backspaceKeyNavigationEnabled]);
    14981498
     1499#if ENABLE(VIDEO_TRACK)
     1500    settings->setShouldDisplaySubtitles([preferences shouldDisplaySubtitles]);
     1501    settings->setShouldDisplayCaptions([preferences shouldDisplayCaptions]);
     1502    settings->setShouldDisplayTextDescriptions([preferences shouldDisplayTextDescriptions]);
     1503#endif
     1504
    14991505    // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
    15001506    [WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];
  • trunk/Source/WebKit/win/ChangeLog

    r101808 r101977  
     12011-12-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        WebKit/mac part of: Add WebKit preferences for text track settings
     4        https://bugs.webkit.org/show_bug.cgi?id=73721
     5
     6        Reviewed by John Sullivan.
     7
     8        * Interfaces/IWebPreferences.idl: Declare getters and setters for new properties.
     9
     10        * WebPreferenceKeysPrivate.h: Added #define for shouldDisplaySubtitles, shouldDisplayCaptions,
     11        and shouldDisplayTextDescriptions properties.
     12
     13        * WebPreferences.cpp:
     14        (WebPreferences::setShouldDisplaySubtitles): Added.
     15        (WebPreferences::shouldDisplaySubtitles): Ditto.
     16        (WebPreferences::setShouldDisplayCaptions): Ditto.
     17        (WebPreferences::shouldDisplayCaptions): Ditto.
     18        (WebPreferences::setShouldDisplayTextDescriptions): Ditto.
     19        (WebPreferences::shouldDisplayTextDescriptions): Ditto.
     20        * WebPreferences.h: Declare new methods.
     21
     22        * WebView.cpp:
     23        (WebView::notifyPreferencesChanged): Updates WebCore settings from WebKit prefs.
     24
    1252011-12-02  Steve Falkenburg  <sfalken@apple.com>
    226
  • trunk/Source/WebKit/win/Interfaces/IWebPreferences.idl

    r96549 r101977  
    206206    HRESULT pictographFontFamily([out, retval] BSTR* family);
    207207    HRESULT setPictographFontFamily([in] BSTR family);
     208
     209    HRESULT setShouldDisplaySubtitles(BOOL shouldDisplaySubtitles);
     210    HRESULT shouldDisplaySubtitles(BOOL *shouldDisplaySubtitles);
     211
     212    HRESULT setShouldDisplayCaptions(BOOL shouldDisplayCaptions);
     213    HRESULT shouldDisplayCaptions(BOOL *shouldDisplayCaptions);
     214
     215    HRESULT setShouldDisplayTextDescriptions(BOOL shouldDisplayTextDescriptions);
     216    HRESULT shouldDisplayTextDescriptions(BOOL *shouldDisplayTextDescriptions);
    208217}
  • trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h

    r96549 r101977  
    7171#define WebKitHyperlinkAuditingEnabledPreferenceKey "WebKitHyperlinkAuditingEnabled"
    7272#define WebKitWebAudioEnabledPreferenceKey "WebKitWebAudioEnabled"
     73#define WebKitShouldDisplaySubtitlesPreferenceKey "WebKitShouldDisplaySubtitles"
     74#define WebKitShouldDisplayCaptionsPreferenceKey "WebKitShouldDisplayCaptions"
     75#define WebKitShouldDisplayTextDescriptionsPreferenceKey "WebKitShouldDisplayTextDescriptions"
    7376
    7477// These are private both because callers should be using the cover methods and because the
  • trunk/Source/WebKit/win/WebPreferences.cpp

    r96549 r101977  
    229229    CFDictionaryAddValue(defaults, CFSTR(WebKitPDFDisplayModePreferenceKey), CFSTR("1"));
    230230    CFDictionaryAddValue(defaults, CFSTR(WebKitPDFScaleFactorPreferenceKey), CFSTR("0"));
     231    CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplaySubtitlesPreferenceKey), kCFBooleanFalse);
     232    CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplayCaptionsPreferenceKey), kCFBooleanFalse);
     233    CFDictionaryAddValue(defaults, CFSTR(WebKitShouldDisplayTextDescriptionsPreferenceKey), kCFBooleanFalse);
    231234
    232235    RetainPtr<CFStringRef> linkBehaviorStringRef(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%d"), WebKitEditableLinkDefaultBehavior));
     
    16501653    }
    16511654}
     1655
     1656HRESULT WebPreferences::shouldDisplaySubtitles(BOOL* enabled)
     1657{
     1658#if ENABLE(VIDEO_TRACK)
     1659    if (!enabled)
     1660        return E_POINTER;
     1661
     1662    *enabled = boolValueForKey(CFSTR(WebKitShouldDisplaySubtitlesPreferenceKey));
     1663    return S_OK;
     1664#else
     1665    return E_NOTIMPL;
     1666#endif
     1667}
     1668
     1669HRESULT WebPreferences::setShouldDisplaySubtitles(BOOL enabled)
     1670{
     1671#if ENABLE(VIDEO_TRACK)
     1672    setBoolValue(CFSTR(WebKitShouldDisplaySubtitlesPreferenceKey), enabled);
     1673    return S_OK;
     1674#else
     1675    return E_NOTIMPL;
     1676#endif
     1677}
     1678
     1679HRESULT WebPreferences::shouldDisplayCaptions(BOOL* enabled)
     1680{
     1681#if ENABLE(VIDEO_TRACK)
     1682    if (!enabled)
     1683        return E_POINTER;
     1684
     1685    *enabled = boolValueForKey(CFSTR(WebKitShouldDisplayCaptionsPreferenceKey));
     1686    return S_OK;
     1687#else
     1688    return E_NOTIMPL;
     1689#endif
     1690}
     1691
     1692HRESULT WebPreferences::setShouldDisplayCaptions(BOOL enabled)
     1693{
     1694#if ENABLE(VIDEO_TRACK)
     1695    setBoolValue(CFSTR(WebKitShouldDisplayCaptionsPreferenceKey), enabled);
     1696    return S_OK;
     1697#else
     1698    return E_NOTIMPL;
     1699#endif
     1700}
     1701
     1702HRESULT WebPreferences::shouldDisplayTextDescriptions(BOOL* enabled)
     1703{
     1704#if ENABLE(VIDEO_TRACK)
     1705    if (!enabled)
     1706        return E_POINTER;
     1707
     1708    *enabled = boolValueForKey(CFSTR(WebKitShouldDisplayTextDescriptionsPreferenceKey));
     1709    return S_OK;
     1710#else
     1711    return E_NOTIMPL;
     1712#endif
     1713}
     1714
     1715HRESULT WebPreferences::setShouldDisplayTextDescriptions(BOOL enabled)
     1716{
     1717#if ENABLE(VIDEO_TRACK)
     1718    setBoolValue(CFSTR(WebKitShouldDisplayTextDescriptionsPreferenceKey), enabled);
     1719    return S_OK;
     1720#else
     1721    return E_NOTIMPL;
     1722#endif
     1723}
  • trunk/Source/WebKit/win/WebPreferences.h

    r96549 r101977  
    296296    /* [retval][out] */ BOOL*);
    297297
     298    virtual HRESULT STDMETHODCALLTYPE setShouldDisplaySubtitles(
     299    /* [in] */ BOOL);
     300
     301    virtual HRESULT STDMETHODCALLTYPE shouldDisplaySubtitles(
     302    /* [retval][out] */ BOOL*);
     303
     304    virtual HRESULT STDMETHODCALLTYPE setShouldDisplayCaptions(
     305    /* [in] */ BOOL);
     306
     307    virtual HRESULT STDMETHODCALLTYPE shouldDisplayCaptions(
     308    /* [retval][out] */ BOOL*);
     309
     310    virtual HRESULT STDMETHODCALLTYPE setShouldDisplayTextDescriptions(
     311    /* [in] */ BOOL);
     312
     313    virtual HRESULT STDMETHODCALLTYPE shouldDisplayTextDescriptions(
     314    /* [retval][out] */ BOOL*);
     315
    298316    // IWebPreferencesPrivate
    299317    virtual HRESULT STDMETHODCALLTYPE setDeveloperExtrasEnabled(
  • trunk/Source/WebKit/win/WebView.cpp

    r101808 r101977  
    45854585    SysFreeString(str);
    45864586
     4587#if ENABLE(VIDEO_TRACK)
     4588    hr = preferences->shouldDisplaySubtitles(&enabled);
     4589    if (FAILED(hr))
     4590        return hr;
     4591    settings->setShouldDisplaySubtitles(enabled);
     4592
     4593    hr = preferences->shouldDisplayCaptions(&enabled);
     4594    if (FAILED(hr))
     4595        return hr;
     4596    settings->setShouldDisplayCaptions(enabled);
     4597
     4598    hr = preferences->shouldDisplayTextDescriptions(&enabled);
     4599    if (FAILED(hr))
     4600        return hr;
     4601    settings->setShouldDisplayTextDescriptions(enabled);
     4602#endif
     4603
    45874604    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
    45884605    if (prefsPrivate) {
  • trunk/Source/WebKit2/ChangeLog

    r101963 r101977  
     12011-12-05  Eric Carlson  <eric.carlson@apple.com>
     2
     3        WebKit2 part of: Add WebKit preferences for text track settings
     4        https://bugs.webkit.org/show_bug.cgi?id=73721
     5
     6        Reviewed by John Sullivan.
     7
     8        * Shared/WebPreferencesStore.h: Declared shouldDisplaySubtitles, shouldDisplayCaptions, and
     9        shouldDisplayTextDescriptions properties with macros. All default to false.
     10
     11        * UIProcess/API/C/WKPreferences.cpp:
     12        (WKPreferencesSetShouldDisplaySubtitles): Added.
     13        (WKPreferencesGetShouldDisplaySubtitles): Ditto.
     14        (WKPreferencesSetShouldDisplayCaptions): Ditto.
     15        (WKPreferencesGetShouldDisplayCaptions): Ditto.
     16        (WKPreferencesSetShouldDisplayTextDescriptions): Ditto.
     17        (WKPreferencesGetShouldDisplayTextDescriptions): Ditto.
     18        * UIProcess/API/C/WKPreferences.h:
     19
     20        * WebProcess/WebPage/WebPage.cpp:
     21        (WebKit::WebPage::updatePreferences): Updates WebCore settings from WebKit2 prefs.
     22
    1232011-12-04  Gopal Raghavan  <gopal.1.raghavan@nokia.com>
    224
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r100153 r101977  
    9999    macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, true) \
    100100    macro(CaretBrowsingEnabled, caretBrowsingEnabled, Bool, bool, false) \
     101    macro(ShouldDisplaySubtitles, shouldDisplaySubtitles, Bool, bool, false) \
     102    macro(ShouldDisplayCaptions, shouldDisplayCaptions, Bool, bool, false) \
     103    macro(ShouldDisplayTextDescriptions, shouldDisplayTextDescriptions, Bool, bool, false) \
    101104    \
    102105
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r100153 r101977  
    672672    return toImpl(preferencesRef)->caretBrowsingEnabled();
    673673}
     674
     675void WKPreferencesSetShouldDisplaySubtitles(WKPreferencesRef preferencesRef, bool enabled)
     676{
     677    toImpl(preferencesRef)->setShouldDisplaySubtitles(enabled);
     678}
     679
     680bool WKPreferencesGetShouldDisplaySubtitles(WKPreferencesRef preferencesRef)
     681{
     682    return toImpl(preferencesRef)->shouldDisplaySubtitles();
     683}
     684
     685void WKPreferencesSetShouldDisplayCaptions(WKPreferencesRef preferencesRef, bool enabled)
     686{
     687    toImpl(preferencesRef)->setShouldDisplayCaptions(enabled);
     688}
     689
     690bool WKPreferencesGetShouldDisplayCaptions(WKPreferencesRef preferencesRef)
     691{
     692    return toImpl(preferencesRef)->shouldDisplayCaptions();
     693}
     694
     695void WKPreferencesSetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef, bool enabled)
     696{
     697    toImpl(preferencesRef)->setShouldDisplayTextDescriptions(enabled);
     698}
     699
     700bool WKPreferencesGetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef)
     701{
     702    return toImpl(preferencesRef)->shouldDisplayTextDescriptions();
     703}
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.h

    r100153 r101977  
    182182WK_EXPORT bool WKPreferencesGetCaretBrowsingEnabled(WKPreferencesRef preferencesRef);
    183183
     184// Defaults to false
     185WK_EXPORT void WKPreferencesSetShouldDisplaySubtitles(WKPreferencesRef preferencesRef, bool enabled);
     186WK_EXPORT bool WKPreferencesGetShouldDisplaySubtitles(WKPreferencesRef preferencesRef);
     187
     188// Defaults to false
     189WK_EXPORT void WKPreferencesSetShouldDisplayCaptions(WKPreferencesRef preferencesRef, bool enabled);
     190WK_EXPORT bool WKPreferencesGetShouldDisplayCaptions(WKPreferencesRef preferencesRef);
     191
     192// Defaults to false
     193WK_EXPORT void WKPreferencesSetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef, bool enabled);
     194WK_EXPORT bool WKPreferencesGetShouldDisplayTextDescriptions(WKPreferencesRef preferencesRef);
     195
    184196#ifdef __cplusplus
    185197}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r101719 r101977  
    18141814    settings->setCaretBrowsingEnabled(store.getBoolValueForKey(WebPreferencesKey::caretBrowsingEnabledKey()));
    18151815
     1816#if ENABLE(VIDEO_TRACK)
     1817    settings->setShouldDisplaySubtitles(store.getBoolValueForKey(WebPreferencesKey::shouldDisplaySubtitlesKey()));
     1818    settings->setShouldDisplayCaptions(store.getBoolValueForKey(WebPreferencesKey::shouldDisplayCaptionsKey()));
     1819    settings->setShouldDisplayTextDescriptions(store.getBoolValueForKey(WebPreferencesKey::shouldDisplayTextDescriptionsKey()));
     1820#endif
     1821
    18161822    platformPreferencesDidChange(store);
    18171823}
Note: See TracChangeset for help on using the changeset viewer.