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

Unified Diff: content/child/blink_platform_impl.cc

Issue 2571863003: Add explicit conversions methods for WebString <-> string16 (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Source/platform/exported/WebString.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 1f401ec96bd692ca5f1e8b7104fa8c8de3624ecf..4d7b82023f6423ac6dec61e4dec06db918251837 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -687,12 +687,14 @@ WebString BlinkPlatformImpl::queryLocalizedString(
int message_id = ToMessageID(name);
if (message_id < 0)
return WebString();
- return GetContentClient()->GetLocalizedString(message_id);
+ return WebString::fromUTF16(
+ GetContentClient()->GetLocalizedString(message_id));
}
WebString BlinkPlatformImpl::queryLocalizedString(
WebLocalizedString::Name name, int numeric_value) {
- return queryLocalizedString(name, base::IntToString16(numeric_value));
+ return queryLocalizedString(
+ name, WebString::fromUTF16(base::IntToString16(numeric_value)));
}
WebString BlinkPlatformImpl::queryLocalizedString(
@@ -700,8 +702,8 @@ WebString BlinkPlatformImpl::queryLocalizedString(
int message_id = ToMessageID(name);
if (message_id < 0)
return WebString();
- return base::ReplaceStringPlaceholders(
- GetContentClient()->GetLocalizedString(message_id), value, NULL);
+ return WebString::fromUTF16(base::ReplaceStringPlaceholders(
+ GetContentClient()->GetLocalizedString(message_id), value.utf16(), NULL));
}
WebString BlinkPlatformImpl::queryLocalizedString(
@@ -713,10 +715,10 @@ WebString BlinkPlatformImpl::queryLocalizedString(
return WebString();
std::vector<base::string16> values;
values.reserve(2);
- values.push_back(value1);
- values.push_back(value2);
- return base::ReplaceStringPlaceholders(
- GetContentClient()->GetLocalizedString(message_id), values, NULL);
+ values.push_back(value1.utf16());
+ values.push_back(value2.utf16());
+ return WebString::fromUTF16(base::ReplaceStringPlaceholders(
+ GetContentClient()->GetLocalizedString(message_id), values, NULL));
}
blink::WebThread* BlinkPlatformImpl::compositorThread() const {
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/exported/WebString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698