summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authortsergeant <tsergeant@chromium.org>2015-09-17 21:10:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-18 04:10:41 +0000
commit5c0b09e2e9f54ced8a020dc2d9ae381089d7a049 (patch)
tree253b71cae3b6bab27c4f6bee1c1f4763c0cffefd /pdf
parent5a6686873a1727894b3144257f8ef41356d28996 (diff)
downloadchromium_src-5c0b09e2e9f54ced8a020dc2d9ae381089d7a049.zip
chromium_src-5c0b09e2e9f54ced8a020dc2d9ae381089d7a049.tar.gz
chromium_src-5c0b09e2e9f54ced8a020dc2d9ae381089d7a049.tar.bz2
PDF: Use chrome.resourcesPrivate instead of Pepper to display translated strings
This new API is significantly simpler, and easier to add new strings to. BUG=506035 Review URL: https://codereview.chromium.org/1329213002 Cr-Commit-Position: refs/heads/master@{#349611}
Diffstat (limited to 'pdf')
-rw-r--r--pdf/out_of_process_instance.cc26
-rw-r--r--pdf/out_of_process_instance.h2
2 files changed, 0 insertions, 28 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 0c0124e..3478b78 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -103,11 +103,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";
@@ -328,19 +323,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;
@@ -1359,14 +1341,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;
diff --git a/pdf/out_of_process_instance.h b/pdf/out_of_process_instance.h
index e763134..69c5bc3 100644
--- a/pdf/out_of_process_instance.h
+++ b/pdf/out_of_process_instance.h
@@ -169,8 +169,6 @@ class OutOfProcessInstance : public pp::Instance,
void FormDidOpen(int32_t result);
- std::string GetLocalizedString(PP_ResourceString id);
-
void UserMetricsRecordAction(const std::string& action);
enum DocumentLoadState {