Chromium Code Reviews| Index: content/common/font_list_win.cc |
| =================================================================== |
| --- content/common/font_list_win.cc (revision 85492) |
| +++ content/common/font_list_win.cc (working copy) |
| @@ -2,32 +2,35 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/ui/webui/options/font_settings_utils.h" |
| +#include "content/common/font_list.h" |
| #include <set> |
| #include <string> |
|
viettrungluu
2011/05/18 20:40:43
I suppose there's no longer a need to include <str
|
| #include <windows.h> |
|
viettrungluu
2011/05/18 20:40:43
Is this include order really kosher?
|
| +#include "base/string16.h" |
| #include "base/values.h" |
| -static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEXW *logical_font, |
| - NEWTEXTMETRICEXW *physical_font, |
| +namespace content { |
| + |
| +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); |
| + std::set<string16>* font_names = |
| + reinterpret_cast<std::set<string16>*>(lparam); |
| if (font_names) { |
| const LOGFONTW& lf = logical_font->elfLogFont; |
| if (lf.lfFaceName[0] && lf.lfFaceName[0] != '@') { |
| - std::wstring face_name(lf.lfFaceName); |
| + string16 face_name(lf.lfFaceName); |
| font_names->insert(face_name); |
| } |
| } |
| return 1; |
| } |
| -ListValue* FontSettingsUtilities::GetFontsList() { |
| - std::set<std::wstring> font_names; |
| +ListValue* GetFontList_SlowBlocking() { |
| + std::set<string16> font_names; |
| LOGFONTW logfont; |
| memset(&logfont, 0, sizeof(logfont)); |
| @@ -39,7 +42,7 @@ |
| ::ReleaseDC(NULL, hdc); |
| ListValue* font_list = new ListValue; |
| - std::set<std::wstring>::iterator iter; |
| + std::set<string16>::iterator iter; |
| for (iter = font_names.begin(); iter != font_names.end(); iter++) { |
| ListValue* font_item = new ListValue(); |
| font_item->Append(Value::CreateStringValue(*iter)); |
| @@ -49,7 +52,4 @@ |
| return font_list; |
| } |
| -void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) { |
| - // nothing to do for Windows. |
| -} |
| - |
| +} // namespace content |