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

Unified Diff: pdf/out_of_process_instance.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: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 6ab52be5e8c32ef9dbabae4fd62645c3fb18193c..b56aa4c0dd1d85c018406cdbd225eceaee98707f 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -107,11 +107,6 @@ const char kJSPreviewPageIndex[] = "index";
const char kJSSetScrollPositionType[] = "setScrollPosition";
const char kJSPositionX[] = "x";
const char kJSPositionY[] = "y";
-// Set translated strings (Plugin -> Page)
-const char kJSSetTranslatedStringsType[] = "setTranslatedStrings";
-const char kJSGetPasswordString[] = "getPasswordString";
-const char kJSLoadingString[] = "loadingString";
-const char kJSLoadFailedString[] = "loadFailedString";
// Request accessibility JSON data (Page -> Plugin)
const char kJSGetAccessibilityJSONType[] = "getAccessibilityJSON";
const char kJSAccessibilityPageNumber[] = "page";
@@ -332,19 +327,6 @@ bool OutOfProcessInstance::Init(uint32_t argc,
if (full_)
SetPluginToHandleFindRequests();
- // Send translated strings to the extension where they will be displayed.
- // TODO(raymes): It would be better to get these in the extension directly
- // through an API but no such API currently exists.
- pp::VarDictionary translated_strings;
- translated_strings.Set(kType, kJSSetTranslatedStringsType);
- translated_strings.Set(kJSGetPasswordString,
- GetLocalizedString(PP_RESOURCESTRING_PDFGETPASSWORD));
- translated_strings.Set(kJSLoadingString,
- GetLocalizedString(PP_RESOURCESTRING_PDFLOADING));
- translated_strings.Set(kJSLoadFailedString,
- GetLocalizedString(PP_RESOURCESTRING_PDFLOAD_FAILED));
- PostMessage(translated_strings);
-
text_input_.reset(new pp::TextInput_Dev(this));
const char* stream_url = nullptr;
@@ -1365,14 +1347,6 @@ void OutOfProcessInstance::SetZoom(double scale) {
OnGeometryChanged(old_zoom, device_scale_);
}
-std::string OutOfProcessInstance::GetLocalizedString(PP_ResourceString id) {
- pp::Var rv(pp::PDF::GetLocalizedString(this, id));
- if (!rv.is_string())
- return std::string();
-
- return rv.AsString();
-}
-
void OutOfProcessInstance::AppendBlankPrintPreviewPages() {
if (print_preview_page_count_ == 0)
return;

Powered by Google App Engine
This is Rietveld 408576698