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

Unified Diff: chrome/browser/ui/webui/options/font_settings_utils_win.cc

Issue 7044012: Support getting the font list in Pepper. This currently only works out of (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « chrome/browser/ui/webui/options/font_settings_utils_mac.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/font_settings_utils_win.cc
===================================================================
--- chrome/browser/ui/webui/options/font_settings_utils_win.cc (revision 85766)
+++ chrome/browser/ui/webui/options/font_settings_utils_win.cc (working copy)
@@ -4,52 +4,8 @@
#include "chrome/browser/ui/webui/options/font_settings_utils.h"
-#include <set>
-#include <string>
-#include <windows.h>
-
-#include "base/values.h"
-
-static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEXW *logical_font,
- NEWTEXTMETRICEXW *physical_font,
- DWORD font_type,
- LPARAM lparam) {
- std::set<std::wstring>* font_names =
- reinterpret_cast<std::set<std::wstring>*>(lparam);
- if (font_names) {
- const LOGFONTW& lf = logical_font->elfLogFont;
- if (lf.lfFaceName[0] && lf.lfFaceName[0] != '@') {
- std::wstring face_name(lf.lfFaceName);
- font_names->insert(face_name);
- }
- }
- return 1;
-}
-
-ListValue* FontSettingsUtilities::GetFontsList() {
- std::set<std::wstring> font_names;
-
- LOGFONTW logfont;
- memset(&logfont, 0, sizeof(logfont));
- logfont.lfCharSet = DEFAULT_CHARSET;
-
- HDC hdc = ::GetDC(NULL);
- ::EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)&EnumFontFamExProc,
- (LPARAM)&font_names, 0);
- ::ReleaseDC(NULL, hdc);
-
- ListValue* font_list = new ListValue;
- std::set<std::wstring>::iterator iter;
- for (iter = font_names.begin(); iter != font_names.end(); iter++) {
- ListValue* font_item = new ListValue();
- font_item->Append(Value::CreateStringValue(*iter));
- font_item->Append(Value::CreateStringValue(*iter));
- font_list->Append(font_item);
- }
- return font_list;
-}
-
+// static
void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) {
- // nothing to do for Windows.
+ // Nothing to do for Windows.
}
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_utils_mac.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698