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

Unified Diff: chrome/renderer/extensions/extension_process_bindings.cc

Issue 347019: Convert ReplaceStringPlaceholders(std::string...) to take a (Closed)
Patch Set: a Created 11 years, 2 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/dom_ui/dom_ui_theme_source.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/extension_process_bindings.cc
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 428281e4072ac70460b4b9cf7759f6b373b57654..2a69afd3ae00228c116e25bd25bb500e823f9c4c 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -325,7 +325,7 @@ class ExtensionImpl : public ExtensionBase {
std::string message =
ExtensionMessageBundle::GetL10nMessage(message_name, *l10n_messages);
- std::vector<string16> substitutions;
+ std::vector<std::string> substitutions;
if (args[1]->IsNull() || args[1]->IsUndefined()) {
// chrome.i18n.getMessage("message_name");
// chrome.i18n.getMessage("message_name", null);
@@ -333,7 +333,7 @@ class ExtensionImpl : public ExtensionBase {
} else if (args[1]->IsString()) {
// chrome.i18n.getMessage("message_name", "one param");
std::string substitute = *v8::String::Utf8Value(args[1]->ToString());
- substitutions.push_back(UTF8ToUTF16(substitute));
+ substitutions.push_back(substitute);
} else if (args[1]->IsArray()) {
// chrome.i18n.getMessage("message_name", ["more", "params"]);
v8::Array* placeholders = static_cast<v8::Array*>(*args[1]);
@@ -343,15 +343,15 @@ class ExtensionImpl : public ExtensionBase {
std::string substitute =
*v8::String::Utf8Value(
placeholders->Get(v8::Integer::New(i))->ToString());
- substitutions.push_back(UTF8ToUTF16(substitute));
+ substitutions.push_back(substitute);
}
} else {
NOTREACHED() << "Couldn't parse second parameter.";
return v8::Undefined();
}
- return v8::String::New(UTF16ToUTF8(ReplaceStringPlaceholders(
- UTF8ToUTF16(message), substitutions, NULL)).c_str());
+ return v8::String::New(ReplaceStringPlaceholders(
+ message, substitutions, NULL).c_str());
}
// Common code for starting an API request to the browser. |value_args|
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_theme_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698