Changeset 142383 in webkit
- Timestamp:
- Feb 9, 2013 4:50:59 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142382 r142383 1 2013-02-09 Eric Carlson <eric.carlson@apple.com> 2 3 [Mac] Do not assume MediaAccessibility framework is installed 4 https://bugs.webkit.org/show_bug.cgi?id=109365 5 6 Reviewed by Sam Weinig. 7 8 * page/CaptionUserPreferencesMac.h: 9 * page/CaptionUserPreferencesMac.mm: 10 (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): Call the base class if the framework 11 is not available. 12 (WebCore::CaptionUserPreferencesMac::setUserPrefersCaptions): Ditto. 13 (WebCore::CaptionUserPreferencesMac::userHasCaptionPreferences): Ditto. 14 (WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Ditto. 15 (WebCore::CaptionUserPreferencesMac::unregisterForCaptionPreferencesChangedCallbacks): Ditto. 16 (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Ditto. 17 (WebCore::CaptionUserPreferencesMac::captionFontSizeScale): Ditto. 18 (WebCore::CaptionUserPreferencesMac::setPreferredLanguage): Ditto. 19 (WebCore::CaptionUserPreferencesMac::preferredLanguages): Ditto. 20 1 21 2013-02-09 Dominic Mazzoni <dmazzoni@google.com> 2 22 -
trunk/Source/WebCore/page/CaptionUserPreferencesMac.h
r141864 r142383 44 44 virtual bool userPrefersCaptions() const OVERRIDE; 45 45 virtual void setUserPrefersCaptions(bool) OVERRIDE; 46 virtual bool userHasCaptionPreferences() const OVERRIDE { return true; }46 virtual bool userHasCaptionPreferences() const OVERRIDE; 47 47 virtual float captionFontSizeScale(bool&) const OVERRIDE; 48 48 virtual String captionsStyleSheetOverride() const OVERRIDE; -
trunk/Source/WebCore/page/CaptionUserPreferencesMac.mm
r142349 r142383 103 103 bool CaptionUserPreferencesMac::userPrefersCaptions() const 104 104 { 105 if (!MediaAccessibilityLibrary()) 106 return CaptionUserPreferences::userPrefersCaptions(); 107 105 108 return MACaptionAppearanceGetShowCaptions(kMACaptionAppearanceDomainUser); 106 109 } … … 108 111 void CaptionUserPreferencesMac::setUserPrefersCaptions(bool preference) 109 112 { 113 if (!MediaAccessibilityLibrary()) { 114 CaptionUserPreferences::setUserPrefersCaptions(preference); 115 return; 116 } 117 110 118 MACaptionAppearanceSetShowCaptions(kMACaptionAppearanceDomainUser, preference); 111 119 } 112 120 121 bool CaptionUserPreferencesMac::userHasCaptionPreferences() const 122 { 123 if (!MediaAccessibilityLibrary()) 124 return CaptionUserPreferences::userHasCaptionPreferences(); 125 126 return !MediaAccessibilityLibrary(); 127 } 128 113 129 void CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener* listener) 114 130 { 131 if (!MediaAccessibilityLibrary()) { 132 CaptionUserPreferences::registerForCaptionPreferencesChangedCallbacks(listener); 133 return; 134 } 135 115 136 ASSERT(!m_captionPreferenceChangeListeners.contains(listener)); 116 137 … … 129 150 void CaptionUserPreferencesMac::unregisterForCaptionPreferencesChangedCallbacks(CaptionPreferencesChangedListener* listener) 130 151 { 152 if (!MediaAccessibilityLibrary()) { 153 CaptionUserPreferences::unregisterForCaptionPreferencesChangedCallbacks(listener); 154 return; 155 } 156 131 157 if (kMAXCaptionAppearanceSettingsChangedNotification) 132 158 m_captionPreferenceChangeListeners.remove(listener); … … 333 359 String CaptionUserPreferencesMac::captionsStyleSheetOverride() const 334 360 { 361 if (!MediaAccessibilityLibrary()) 362 return CaptionUserPreferences::captionsStyleSheetOverride(); 363 335 364 StringBuilder captionsOverrideStyleSheet; 336 365 … … 375 404 float CaptionUserPreferencesMac::captionFontSizeScale(bool& important) const 376 405 { 406 if (!MediaAccessibilityLibrary()) 407 return CaptionUserPreferences::captionFontSizeScale(important); 408 377 409 MACaptionAppearanceBehavior behavior; 378 410 CGFloat characterScale = CaptionUserPreferences::captionFontSizeScale(important); … … 418 450 void CaptionUserPreferencesMac::setPreferredLanguage(String language) const 419 451 { 452 if (!MediaAccessibilityLibrary()) { 453 CaptionUserPreferences::setPreferredLanguage(language); 454 return; 455 } 456 420 457 MACaptionAppearanceAddSelectedLanguage(kMACaptionAppearanceDomainUser, language.createCFString().get()); 421 458 } … … 426 463 if (!override.isEmpty()) 427 464 return override; 465 466 if (!MediaAccessibilityLibrary()) 467 return CaptionUserPreferences::preferredLanguages(); 428 468 429 469 RetainPtr<CFArrayRef> languages(AdoptCF, MACaptionAppearanceCopySelectedLanguages(kMACaptionAppearanceDomainUser));
Note: See TracChangeset
for help on using the changeset viewer.