| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/font_list.h" | 5 #include "content/common/font_list.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 HDC hdc = ::GetDC(NULL); | 40 HDC hdc = ::GetDC(NULL); |
| 41 ::EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)&EnumFontFamExProc, | 41 ::EnumFontFamiliesExW(hdc, &logfont, (FONTENUMPROCW)&EnumFontFamExProc, |
| 42 (LPARAM)&font_names, 0); | 42 (LPARAM)&font_names, 0); |
| 43 ::ReleaseDC(NULL, hdc); | 43 ::ReleaseDC(NULL, hdc); |
| 44 | 44 |
| 45 std::unique_ptr<base::ListValue> font_list(new base::ListValue); | 45 std::unique_ptr<base::ListValue> font_list(new base::ListValue); |
| 46 std::set<base::string16>::iterator iter; | 46 std::set<base::string16>::iterator iter; |
| 47 for (iter = font_names.begin(); iter != font_names.end(); ++iter) { | 47 for (iter = font_names.begin(); iter != font_names.end(); ++iter) { |
| 48 base::ListValue* font_item = new base::ListValue(); | 48 base::ListValue* font_item = new base::ListValue(); |
| 49 font_item->Append(new base::StringValue(*iter)); | 49 font_item->Append(new base::Value(*iter)); |
| 50 font_item->Append(new base::StringValue(*iter)); | 50 font_item->Append(new base::Value(*iter)); |
| 51 font_list->Append(font_item); | 51 font_list->Append(font_item); |
| 52 } | 52 } |
| 53 return font_list; | 53 return font_list; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| OLD | NEW |