diff options
author | tsergeant <tsergeant@chromium.org> | 2015-09-17 21:10:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-18 04:10:41 +0000 |
commit | 5c0b09e2e9f54ced8a020dc2d9ae381089d7a049 (patch) | |
tree | 253b71cae3b6bab27c4f6bee1c1f4763c0cffefd /pdf/out_of_process_instance.cc | |
parent | 5a6686873a1727894b3144257f8ef41356d28996 (diff) | |
download | chromium_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/out_of_process_instance.cc')
-rw-r--r-- | pdf/out_of_process_instance.cc | 26 |
1 files changed, 0 insertions, 26 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; |