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

Unified Diff: components/pdf/renderer/pepper_pdf_host.cc

Issue 1329213002: PDF: Use chrome.resourcesPrivate instead of Pepper to display translated strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@i18n_api
Patch Set: Created 5 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: components/pdf/renderer/pepper_pdf_host.cc
diff --git a/components/pdf/renderer/pepper_pdf_host.cc b/components/pdf/renderer/pepper_pdf_host.cc
index 5714d26acbbd3b3e81d45f724940be4673ebd098..e84adf2c2120d9f0bcff455d524328a57af5d4d3 100644
--- a/components/pdf/renderer/pepper_pdf_host.cc
+++ b/components/pdf/renderer/pepper_pdf_host.cc
@@ -40,26 +40,6 @@ namespace {
base::LazyInstance<base::ThreadLocalPointer<PepperPDFHost::PrintClient>>::Leaky
g_print_client_tls = LAZY_INSTANCE_INITIALIZER;
-std::string GetStringResource(PP_ResourceString string_id) {
- int resource_id = 0;
- switch (string_id) {
- case PP_RESOURCESTRING_PDFGETPASSWORD:
- resource_id = IDS_PDF_NEED_PASSWORD;
- break;
- case PP_RESOURCESTRING_PDFLOADING:
- resource_id = IDS_PDF_PAGE_LOADING;
- break;
- case PP_RESOURCESTRING_PDFLOAD_FAILED:
- resource_id = IDS_PDF_PAGE_LOAD_FAILED;
- break;
- case PP_RESOURCESTRING_PDFPROGRESSLOADING:
- resource_id = IDS_PDF_PROGRESS_LOADING;
- break;
- }
-
- return l10n_util::GetStringUTF8(resource_id);
-}
-
} // namespace
PepperPDFHost::PepperPDFHost(content::RendererPpapiHost* host,
@@ -88,8 +68,6 @@ int32_t PepperPDFHost::OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) {
PPAPI_BEGIN_MESSAGE_MAP(PepperPDFHost, msg)
- PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_PDF_GetLocalizedString,
- OnHostMsgGetLocalizedString)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_PDF_DidStartLoading,
OnHostMsgDidStartLoading)
PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_PDF_DidStopLoading,
@@ -111,14 +89,6 @@ int32_t PepperPDFHost::OnResourceMessageReceived(
return PP_ERROR_FAILED;
}
-int32_t PepperPDFHost::OnHostMsgGetLocalizedString(
- ppapi::host::HostMessageContext* context,
- PP_ResourceString string_id) {
- std::string rv = GetStringResource(string_id);
- context->reply_msg = PpapiPluginMsg_PDF_GetLocalizedStringReply(rv);
- return PP_OK;
-}
-
int32_t PepperPDFHost::OnHostMsgDidStartLoading(
ppapi::host::HostMessageContext* context) {
content::PepperPluginInstance* instance =

Powered by Google App Engine
This is Rietveld 408576698