| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Font Settings Extension API implementation. | 5 // Font Settings Extension API implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" | 7 #include "chrome/browser/extensions/api/font_settings/font_settings_api.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 bool success = CopyFontsToResult(list.get()); | 293 bool success = CopyFontsToResult(list.get()); |
| 294 SendResponse(success); | 294 SendResponse(success); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool FontSettingsGetFontListFunction::CopyFontsToResult( | 297 bool FontSettingsGetFontListFunction::CopyFontsToResult( |
| 298 base::ListValue* fonts) { | 298 base::ListValue* fonts) { |
| 299 std::unique_ptr<base::ListValue> result(new base::ListValue()); | 299 std::unique_ptr<base::ListValue> result(new base::ListValue()); |
| 300 for (base::ListValue::iterator it = fonts->begin(); | 300 for (base::ListValue::iterator it = fonts->begin(); |
| 301 it != fonts->end(); ++it) { | 301 it != fonts->end(); ++it) { |
| 302 base::ListValue* font_list_value; | 302 base::ListValue* font_list_value; |
| 303 if (!(*it)->GetAsList(&font_list_value)) { | 303 if (!it->GetAsList(&font_list_value)) { |
| 304 NOTREACHED(); | 304 NOTREACHED(); |
| 305 return false; | 305 return false; |
| 306 } | 306 } |
| 307 | 307 |
| 308 std::string name; | 308 std::string name; |
| 309 if (!font_list_value->GetString(0, &name)) { | 309 if (!font_list_value->GetString(0, &name)) { |
| 310 NOTREACHED(); | 310 NOTREACHED(); |
| 311 return false; | 311 return false; |
| 312 } | 312 } |
| 313 | 313 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 429 |
| 430 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { | 430 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { |
| 431 return prefs::kWebKitMinimumFontSize; | 431 return prefs::kWebKitMinimumFontSize; |
| 432 } | 432 } |
| 433 | 433 |
| 434 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { | 434 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { |
| 435 return kPixelSizeKey; | 435 return kPixelSizeKey; |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace extensions | 438 } // namespace extensions |
| OLD | NEW |