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

Unified Diff: content/browser/renderer_host/pepper/pepper_truetype_font_list_mac.mm

Issue 12600019: Add Pepper TrueType font API plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
Index: content/browser/renderer_host/pepper/pepper_truetype_font_list_mac.mm
diff --git a/content/browser/renderer_host/pepper/pepper_truetype_font_list_mac.mm b/content/browser/renderer_host/pepper/pepper_truetype_font_list_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..3fc20652f15b40bc1a68b13fc9a49840eee6e344
--- /dev/null
+++ b/content/browser/renderer_host/pepper/pepper_truetype_font_list_mac.mm
@@ -0,0 +1,25 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/pepper/pepper_truetype_font_list.h"
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/mac/scoped_nsautorelease_pool.h"
+#include "base/sys_string_conversions.h"
+
+namespace content {
+
+std::vector<std::string> GetFontFamilies_SlowBlocking() {
+ base::mac::ScopedNSAutoreleasePool autorelease_pool;
+ std::vector<std::string> font_families;
+ NSFontManager* fontManager = [[[NSFontManager alloc] init] autorelease];
+ NSArray* fonts = [fontManager availableFontFamilies];
+ for (NSString* family_name in fonts)
+ font_families.push_back(base::SysNSStringToUTF8(family_name));
+
+ return font_families;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698