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

Unified Diff: chrome/browser/ui/webui/options/font_settings_handler.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/font_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc
index 17ccff326340e0b37ccddbfac080fbce6467b9d2..4c7ae3a2eb2e590ff822e1627c6f4e742526a459 100644
--- a/chrome/browser/ui/webui/options/font_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/font_settings_handler.cc
@@ -208,7 +208,7 @@ void FontSettingsHandler::FontsListHasLoaded(
bool has_value = font->GetString(1, &value);
DCHECK(has_value);
bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(value);
- font->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr"));
+ font->AppendString(has_rtl_chars ? "rtl" : "ltr");
}
base::ListValue encoding_list;
@@ -230,27 +230,27 @@ void FontSettingsHandler::FontsListHasLoaded(
CharacterEncoding::GetCanonicalEncodingNameByCommandId(cmd_id);
base::string16 name = it->encoding_display_name;
bool has_rtl_chars = base::i18n::StringContainsStrongRTLChars(name);
- option->Append(new base::StringValue(encoding));
- option->Append(new base::StringValue(name));
- option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr"));
+ option->AppendString(encoding);
+ option->AppendString(name);
+ option->AppendString(has_rtl_chars ? "rtl" : "ltr");
} else {
// Add empty name/value to indicate a separator item.
- option->Append(new base::StringValue(std::string()));
- option->Append(new base::StringValue(std::string()));
+ option->AppendString(std::string());
+ option->AppendString(std::string());
}
encoding_list.Append(option);
}
base::ListValue selected_values;
- selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName(
- standard_font_.GetValue())));
- selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName(
- serif_font_.GetValue())));
- selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName(
- sans_serif_font_.GetValue())));
- selected_values.Append(new base::StringValue(MaybeGetLocalizedFontName(
- fixed_font_.GetValue())));
- selected_values.Append(new base::StringValue(font_encoding_.GetValue()));
+ selected_values.AppendString(
+ MaybeGetLocalizedFontName(standard_font_.GetValue()));
+ selected_values.AppendString(
+ MaybeGetLocalizedFontName(serif_font_.GetValue()));
+ selected_values.AppendString(
+ MaybeGetLocalizedFontName(sans_serif_font_.GetValue()));
+ selected_values.AppendString(
+ MaybeGetLocalizedFontName(fixed_font_.GetValue()));
+ selected_values.AppendString(font_encoding_.GetValue());
web_ui()->CallJavascriptFunction("FontSettings.setFontsData",
*list.get(), encoding_list,
« no previous file with comments | « chrome/browser/ui/webui/options/core_options_handler.cc ('k') | chrome/browser/ui/webui/options/handler_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698