Commit 7219bc45 authored by eric.carlson@apple.com's avatar eric.carlson@apple.com
Browse files

[Mac] use HAVE() macro instead of version check

https://bugs.webkit.org/show_bug.cgi?id=111087

Reviewed by Dean Jackson.

Source/WebCore:

No new tests, covered by existing tests.

* page/CaptionUserPreferencesMac.h: Use HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK).
* page/CaptionUserPreferencesMac.mm: Ditto.
(WebCore::CaptionUserPreferencesMac::CaptionUserPreferencesMac): Ditto.
(WebCore::CaptionUserPreferencesMac::~CaptionUserPreferencesMac): Ditto.

* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferences): Ditto.

Source/WTF:

* wtf/Platform.h: Define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ddc21369
2013-02-28 Eric Carlson <eric.carlson@apple.com>
[Mac] use HAVE() macro instead of version check
https://bugs.webkit.org/show_bug.cgi?id=111087
Reviewed by Dean Jackson.
* wtf/Platform.h: Define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK.
2013-02-27 Balazs Kilvady <kilvadyb@homejinni.com>
 
Bug in atomicIncrement implementation for MIPS GCC
......
......@@ -1020,6 +1020,10 @@
#define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT 1
#endif
#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
#endif
#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(BLACKBERRY)
#define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1
#endif
......
2013-02-28 Eric Carlson <eric.carlson@apple.com>
[Mac] use HAVE() macro instead of version check
https://bugs.webkit.org/show_bug.cgi?id=111087
Reviewed by Dean Jackson.
No new tests, covered by existing tests.
* page/CaptionUserPreferencesMac.h: Use HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK).
* page/CaptionUserPreferencesMac.mm: Ditto.
(WebCore::CaptionUserPreferencesMac::CaptionUserPreferencesMac): Ditto.
(WebCore::CaptionUserPreferencesMac::~CaptionUserPreferencesMac): Ditto.
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferences): Ditto.
2013-02-28 Chris Fleizach <cfleizach@apple.com>
 
WebSpeech: support the boundary event
......@@ -40,7 +40,7 @@ public:
static PassOwnPtr<CaptionUserPreferencesMac> create(PageGroup* group) { return adoptPtr(new CaptionUserPreferencesMac(group)); }
virtual ~CaptionUserPreferencesMac();
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
virtual bool userHasCaptionPreferences() const OVERRIDE;
virtual bool userPrefersCaptions() const OVERRIDE;
virtual void setUserPrefersCaptions(bool) OVERRIDE;
......@@ -60,7 +60,7 @@ public:
private:
CaptionUserPreferencesMac(PageGroup*);
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
String captionsWindowCSS() const;
String captionsBackgroundCSS() const;
String captionsTextColorCSS() const;
......
......@@ -45,11 +45,11 @@
#import <wtf/RetainPtr.h>
#import <wtf/text/StringBuilder.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
#import "MediaAccessibility/MediaAccessibility.h"
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
SOFT_LINK_FRAMEWORK_OPTIONAL(MediaAccessibility)
......@@ -77,7 +77,7 @@ using namespace std;
namespace WebCore {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
{
static_cast<CaptionUserPreferencesMac*>(observer)->captionPreferencesChanged();
......@@ -86,7 +86,7 @@ static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCent
CaptionUserPreferencesMac::CaptionUserPreferencesMac(PageGroup* group)
: CaptionUserPreferences(group)
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
, m_listeningForPreferenceChanges(false)
#endif
{
......@@ -94,13 +94,13 @@ CaptionUserPreferencesMac::CaptionUserPreferencesMac(PageGroup* group)
CaptionUserPreferencesMac::~CaptionUserPreferencesMac()
{
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
if (kMAXCaptionAppearanceSettingsChangedNotification)
CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this, kMAXCaptionAppearanceSettingsChangedNotification, NULL);
#endif
}
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
bool CaptionUserPreferencesMac::userPrefersCaptions() const
{
if (testingMode() || !MediaAccessibilityLibrary())
......
......@@ -39,7 +39,7 @@
#include "StorageNamespace.h"
#if ENABLE(VIDEO_TRACK)
#if PLATFORM(MAC) && !PLATFORM(IOS)
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
#include "CaptionUserPreferencesMac.h"
#else
#include "CaptionUserPreferences.h"
......@@ -420,7 +420,7 @@ void PageGroup::invalidatedInjectedStyleSheetCacheInAllFrames()
CaptionUserPreferences* PageGroup::captionPreferences()
{
if (!m_captionPreferences)
#if PLATFORM(MAC) && !PLATFORM(IOS)
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
m_captionPreferences = CaptionUserPreferencesMac::create(this);
#else
m_captionPreferences = CaptionUserPreferences::create(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment