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

Unified Diff: chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler.cc ('k') | chrome/browser/ui/webui/uber/uber_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
diff --git a/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc b/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
index 43bb3f9b8b5b36c9c7f389f8d208ec64eba7bd76..8827d4e86ab9362a6db8bab57ccf75bce5c9d198 100644
--- a/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
+++ b/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
@@ -89,23 +89,20 @@ void TranslateInternalsHandler::Observe(
base::DictionaryValue dict;
dict.Set("time",
new base::Value(language_detection_details->time.ToJsTime()));
- dict.Set("url",
- new base::StringValue(language_detection_details->url.spec()));
+ dict.Set("url", new base::Value(language_detection_details->url.spec()));
dict.Set("content_language",
- new base::StringValue(language_detection_details->content_language));
+ new base::Value(language_detection_details->content_language));
dict.Set("cld_language",
- new base::StringValue(language_detection_details->cld_language));
+ new base::Value(language_detection_details->cld_language));
dict.Set("is_cld_reliable",
new base::Value(language_detection_details->is_cld_reliable));
dict.Set("has_notranslate",
new base::Value(language_detection_details->has_notranslate));
- dict.Set(
- "html_root_language",
- new base::StringValue(language_detection_details->html_root_language));
+ dict.Set("html_root_language",
+ new base::Value(language_detection_details->html_root_language));
dict.Set("adopted_language",
- new base::StringValue(language_detection_details->adopted_language));
- dict.Set("content",
- new base::StringValue(language_detection_details->contents));
+ new base::Value(language_detection_details->adopted_language));
+ dict.Set("content", new base::Value(language_detection_details->contents));
SendMessageToJs("languageDetectionInfoAdded", dict);
}
@@ -113,7 +110,7 @@ void TranslateInternalsHandler::OnTranslateError(
const translate::TranslateErrorDetails& details) {
base::DictionaryValue dict;
dict.Set("time", new base::Value(details.time.ToJsTime()));
- dict.Set("url", new base::StringValue(details.url.spec()));
+ dict.Set("url", new base::Value(details.url.spec()));
dict.Set("error", new base::Value(details.error));
SendMessageToJs("translateErrorDetailsAdded", dict);
}
@@ -122,9 +119,9 @@ void TranslateInternalsHandler::OnTranslateEvent(
const translate::TranslateEventDetails& details) {
base::DictionaryValue dict;
dict.Set("time", new base::Value(details.time.ToJsTime()));
- dict.Set("filename", new base::StringValue(details.filename));
+ dict.Set("filename", new base::Value(details.filename));
dict.Set("line", new base::Value(details.line));
- dict.Set("message", new base::StringValue(details.message));
+ dict.Set("message", new base::Value(details.message));
SendMessageToJs("translateEventDetailsAdded", dict);
}
@@ -187,7 +184,7 @@ void TranslateInternalsHandler::OnRequestInfo(const base::ListValue* /*args*/) {
void TranslateInternalsHandler::SendMessageToJs(const std::string& message,
const base::Value& value) {
const char func[] = "cr.translateInternals.messageHandler";
- base::StringValue message_data(message);
+ base::Value message_data(message);
web_ui()->CallJavascriptFunctionUnsafe(func, message_data, value);
}
@@ -252,7 +249,7 @@ void TranslateInternalsHandler::SendCountryToJs(bool was_updated) {
base::DictionaryValue dict;
if (!country.empty()) {
- dict.Set("country", new base::StringValue(country));
+ dict.Set("country", new base::Value(country));
dict.Set("update", new base::Value(was_updated));
}
SendMessageToJs("countryUpdated", dict);
« no previous file with comments | « chrome/browser/ui/webui/sync_internals_message_handler.cc ('k') | chrome/browser/ui/webui/uber/uber_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698