Index: chrome/browser/extensions/api/font_settings/font_settings_api.cc |
diff --git a/chrome/browser/extensions/api/font_settings/font_settings_api.cc b/chrome/browser/extensions/api/font_settings/font_settings_api.cc |
index cf01a958e33df9ba0d82949357627cf7e80edca3..09d618dd04d04bac05fa74ef9e03ea159dd7cdeb 100644 |
--- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc |
+++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc |
@@ -86,8 +86,7 @@ void RegisterFontFamilyMapObserver( |
const PrefChangeRegistrar::NamedChangeCallback& callback) { |
for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { |
const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; |
- std::string pref_name = base::StringPrintf("%s.%s", map_name, script); |
- registrar->Add(pref_name.c_str(), callback); |
+ registrar->Add(base::StringPrintf("%s.%s", map_name, script), callback); |
} |
} |
@@ -156,7 +155,7 @@ void FontSettingsEventRouter::OnFontNamePrefChanged( |
const std::string& generic_family, |
const std::string& script) { |
const PrefService::Preference* pref = registrar_.prefs()->FindPreference( |
- pref_name.c_str()); |
+ pref_name); |
CHECK(pref); |
std::string font_name; |
@@ -187,7 +186,7 @@ void FontSettingsEventRouter::OnFontPrefChanged( |
const std::string& key, |
const std::string& pref_name) { |
const PrefService::Preference* pref = registrar_.prefs()->FindPreference( |
- pref_name.c_str()); |
+ pref_name); |
CHECK(pref); |
base::ListValue args; |
@@ -235,10 +234,10 @@ bool FontSettingsClearFontFunction::RunSync() { |
// Ensure |pref_path| really is for a registered per-script font pref. |
EXTENSION_FUNCTION_VALIDATE( |
- GetProfile()->GetPrefs()->FindPreference(pref_path.c_str())); |
+ GetProfile()->GetPrefs()->FindPreference(pref_path)); |
PreferenceAPI::Get(GetProfile())->RemoveExtensionControlledPref( |
- extension_id(), pref_path.c_str(), kExtensionPrefsScopeRegular); |
+ extension_id(), pref_path, kExtensionPrefsScopeRegular); |
return true; |
} |
@@ -252,7 +251,7 @@ bool FontSettingsGetFontFunction::RunSync() { |
PrefService* prefs = GetProfile()->GetPrefs(); |
const PrefService::Preference* pref = |
- prefs->FindPreference(pref_path.c_str()); |
+ prefs->FindPreference(pref_path); |
std::string font_name; |
EXTENSION_FUNCTION_VALIDATE( |
@@ -288,11 +287,11 @@ bool FontSettingsSetFontFunction::RunSync() { |
// Ensure |pref_path| really is for a registered font pref. |
EXTENSION_FUNCTION_VALIDATE( |
- GetProfile()->GetPrefs()->FindPreference(pref_path.c_str())); |
+ GetProfile()->GetPrefs()->FindPreference(pref_path)); |
PreferenceAPI::Get(GetProfile())->SetExtensionControlledPref( |
extension_id(), |
- pref_path.c_str(), |
+ pref_path, |
kExtensionPrefsScopeRegular, |
new base::StringValue(params->details.font_id)); |
return true; |