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

Unified Diff: chrome/browser/extensions/api/font_settings/font_settings_api.cc

Issue 2323993004: Remove use of deprecated base::ListValue::Append(Value*) overload in extensions. (Closed)
Patch Set: ... I hate C++ Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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 1cc64ddb454429bbb61e6eda2c953a87ab44b4d7..9d60a6ce23c17cbc85c144732b94ad0bb59283a1 100644
--- a/chrome/browser/extensions/api/font_settings/font_settings_api.cc
+++ b/chrome/browser/extensions/api/font_settings/font_settings_api.cc
@@ -180,11 +180,11 @@ void FontSettingsEventRouter::OnFontNamePrefChanged(
font_name = MaybeGetLocalizedFontName(font_name);
base::ListValue args;
- base::DictionaryValue* dict = new base::DictionaryValue();
- args.Append(dict);
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString(kFontIdKey, font_name);
dict->SetString(kGenericFamilyKey, generic_family);
dict->SetString(kScriptKey, script);
+ args.Append(std::move(dict));
extensions::preference_helpers::DispatchEventToExtensions(
profile_, events::FONT_SETTINGS_ON_FONT_CHANGED,
@@ -202,9 +202,9 @@ void FontSettingsEventRouter::OnFontPrefChanged(
CHECK(pref);
base::ListValue args;
- base::DictionaryValue* dict = new base::DictionaryValue();
- args.Append(dict);
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->Set(key, pref->GetValue()->DeepCopy());
+ args.Append(std::move(dict));
extensions::preference_helpers::DispatchEventToExtensions(
profile_, histogram_value, event_name, &args,
« no previous file with comments | « chrome/browser/extensions/api/downloads/downloads_api.cc ('k') | chrome/browser/extensions/api/preference/preference_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698