Index: chrome/browser/extensions/extension_font_settings_api.cc |
diff --git a/chrome/browser/extensions/extension_font_settings_api.cc b/chrome/browser/extensions/extension_font_settings_api.cc |
index 3f76f8bd4045c7bba9fa585a270b5ab9b6411af9..1bcf8b2f7d2b638a0eab588c0a831e7a298e364d 100644 |
--- a/chrome/browser/extensions/extension_font_settings_api.cc |
+++ b/chrome/browser/extensions/extension_font_settings_api.cc |
@@ -142,9 +142,9 @@ bool GetFontListFunction::CopyFontsToResult(ListValue* fonts) { |
return true; |
} |
-bool GetDefaultFontSizeFunction::RunImpl() { |
+bool GetFontSizeExtensionFunction::RunImpl() { |
PrefService* prefs = profile_->GetPrefs(); |
- int size = prefs->GetInteger(prefs::kWebKitGlobalDefaultFontSize); |
+ int size = prefs->GetInteger(pref_name()); |
DictionaryValue* result = new DictionaryValue(); |
result->SetInteger(kPixelSizeKey, size); |
@@ -152,7 +152,7 @@ bool GetDefaultFontSizeFunction::RunImpl() { |
return true; |
} |
-bool SetDefaultFontSizeFunction::RunImpl() { |
+bool SetFontSizeExtensionFunction::RunImpl() { |
DictionaryValue* details = NULL; |
EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &details)); |
@@ -161,8 +161,32 @@ bool SetDefaultFontSizeFunction::RunImpl() { |
ExtensionPrefs* prefs = profile_->GetExtensionService()->extension_prefs(); |
prefs->SetExtensionControlledPref(extension_id(), |
- prefs::kWebKitGlobalDefaultFontSize, |
+ pref_name(), |
kExtensionPrefsScopeRegular, |
Value::CreateIntegerValue(size)); |
return true; |
} |
+ |
+const char* GetDefaultFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalDefaultFontSize; |
+} |
+ |
+const char* SetDefaultFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalDefaultFontSize; |
+} |
+ |
+const char* GetDefaultFixedFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalDefaultFixedFontSize; |
+} |
+ |
+const char* SetDefaultFixedFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalDefaultFixedFontSize; |
+} |
+ |
+const char* GetMinimumFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalMinimumFontSize; |
+} |
+ |
+const char* SetMinimumFontSizeFunction::pref_name() { |
+ return prefs::kWebKitGlobalMinimumFontSize; |
+} |