Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: ui/gfx/font_fallback_mac.mm

Issue 1917973002: mac: Remove IsOSLion(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tapted Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/mac/nswindow_frame_controls.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/font_fallback_mac.mm
diff --git a/ui/gfx/font_fallback_mac.mm b/ui/gfx/font_fallback_mac.mm
index aa66729563b5c9387ace84b566260b2c8cf719ce..6ad582dcc8edb42bf4307373ff6c44fb8545af35 100644
--- a/ui/gfx/font_fallback_mac.mm
+++ b/ui/gfx/font_fallback_mac.mm
@@ -14,32 +14,10 @@
#import "base/strings/sys_string_conversions.h"
#include "ui/gfx/font.h"
-// CTFontCopyDefaultCascadeListForLanguages() doesn't exist in the 10.6 SDK.
-// There is only the following. It doesn't exist in the public header files,
-// but is an exported symbol so should always link.
-extern "C" CFArrayRef CTFontCopyDefaultCascadeList(CTFontRef font_ref);
-
-namespace {
-
-// Wrapper for CTFontCopyDefaultCascadeListForLanguages() which should appear in
-// CoreText.h from 10.8 onwards.
-// TODO(tapted): Delete this wrapper when only 10.8+ is supported.
-CFArrayRef CTFontCopyDefaultCascadeListForLanguagesWrapper(
- CTFontRef font_ref,
- CFArrayRef language_pref_list) {
- typedef CFArrayRef (*MountainLionPrototype)(CTFontRef, CFArrayRef);
- static const MountainLionPrototype cascade_with_languages_function =
- reinterpret_cast<MountainLionPrototype>(
- dlsym(RTLD_DEFAULT, "CTFontCopyDefaultCascadeListForLanguages"));
- if (cascade_with_languages_function)
- return cascade_with_languages_function(font_ref, language_pref_list);
-
- // Fallback to the 10.6 Private API.
- DCHECK(base::mac::IsOSLionOrEarlier());
- return CTFontCopyDefaultCascadeList(font_ref);
-}
-
-} // namespace
+// TODO(thakis): Remove this prototype once the deployment target is 10.8+.
+extern "C" CFArrayRef CTFontCopyDefaultCascadeListForLanguages(
+ CTFontRef font,
+ CFArrayRef languagePrefList);
namespace gfx {
@@ -56,7 +34,7 @@ std::vector<Font> GetFallbackFonts(const Font& font) {
stringArrayForKey:@"AppleLanguages"];
CFArrayRef languages_cf = base::mac::NSToCFCast(languages);
base::ScopedCFTypeRef<CFArrayRef> cascade_list(
- CTFontCopyDefaultCascadeListForLanguagesWrapper(
+ CTFontCopyDefaultCascadeListForLanguages(
static_cast<CTFontRef>(font.GetNativeFont()), languages_cf));
std::vector<Font> fallback_fonts;
« no previous file with comments | « ui/base/resource/resource_bundle.cc ('k') | ui/gfx/mac/nswindow_frame_controls.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698