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

Side by Side Diff: chrome/browser/extensions/api/font_settings/font_settings_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/font_settings/font_settings_api.h ('k') | chrome/browser/extensions/api/gcm/gcm_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698