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 "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 GetProfile()->GetPrefs()->FindPreference(pref_path.c_str())); | 291 GetProfile()->GetPrefs()->FindPreference(pref_path.c_str())); |
292 | 292 |
293 PreferenceAPI::Get(GetProfile())->SetExtensionControlledPref( | 293 PreferenceAPI::Get(GetProfile())->SetExtensionControlledPref( |
294 extension_id(), | 294 extension_id(), |
295 pref_path.c_str(), | 295 pref_path.c_str(), |
296 kExtensionPrefsScopeRegular, | 296 kExtensionPrefsScopeRegular, |
297 new base::StringValue(params->details.font_id)); | 297 new base::StringValue(params->details.font_id)); |
298 return true; | 298 return true; |
299 } | 299 } |
300 | 300 |
301 bool FontSettingsGetFontListFunction::RunImpl() { | 301 bool FontSettingsGetFontListFunction::RunAsync() { |
302 content::GetFontListAsync( | 302 content::GetFontListAsync( |
303 Bind(&FontSettingsGetFontListFunction::FontListHasLoaded, this)); | 303 Bind(&FontSettingsGetFontListFunction::FontListHasLoaded, this)); |
304 return true; | 304 return true; |
305 } | 305 } |
306 | 306 |
307 void FontSettingsGetFontListFunction::FontListHasLoaded( | 307 void FontSettingsGetFontListFunction::FontListHasLoaded( |
308 scoped_ptr<base::ListValue> list) { | 308 scoped_ptr<base::ListValue> list) { |
309 bool success = CopyFontsToResult(list.get()); | 309 bool success = CopyFontsToResult(list.get()); |
310 SendResponse(success); | 310 SendResponse(success); |
311 } | 311 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { | 449 const char* FontSettingsSetMinimumFontSizeFunction::GetPrefName() { |
450 return prefs::kWebKitMinimumFontSize; | 450 return prefs::kWebKitMinimumFontSize; |
451 } | 451 } |
452 | 452 |
453 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { | 453 const char* FontSettingsSetMinimumFontSizeFunction::GetKey() { |
454 return kPixelSizeKey; | 454 return kPixelSizeKey; |
455 } | 455 } |
456 | 456 |
457 } // namespace extensions | 457 } // namespace extensions |
OLD | NEW |