Index: chrome/browser/resources/pdf/pdf.js |
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js |
index 6d6411e3e91363828d7dea1c2327fd0f9b7d4ba0..45d552f428970768bdb2627bf7004b77e9270c5f 100644 |
--- a/chrome/browser/resources/pdf/pdf.js |
+++ b/chrome/browser/resources/pdf/pdf.js |
@@ -243,6 +243,9 @@ function PDFViewer(browserApi) { |
onNavigateInCurrentTab, onNavigateInNewTab); |
this.viewportScroller_ = |
new ViewportScroller(this.viewport_, this.plugin_, window); |
+ |
+ // Request translated strings. |
+ chrome.i18nPrivate.getStrings('pdf', this.handleStrings_.bind(this)); |
} |
PDFViewer.prototype = { |
@@ -522,6 +525,16 @@ PDFViewer.prototype = { |
} |
}, |
+ handleStrings_: function(strings) { |
raymes
2015/09/17 03:56:43
nit: add some jsdoc
|
+ this.passwordScreen_.text = strings.passwordPrompt; |
+ if (!this.isMaterial_) { |
+ this.progressBar_.text = strings.pageLoading; |
+ if (!this.isPrintPreview_) |
+ this.progressBar_.style.visibility = 'visible'; |
+ } |
+ this.errorScreen_.text = strings.pageLoadFailed; |
+ }, |
+ |
/** |
* @private |
* An event handler for handling password-submitted events. These are fired |
@@ -599,15 +612,6 @@ PDFViewer.prototype = { |
position.y = message.data.y; |
this.viewport_.position = position; |
break; |
- case 'setTranslatedStrings': |
- this.passwordScreen_.text = message.data.getPasswordString; |
- if (!this.isMaterial_) { |
- this.progressBar_.text = message.data.loadingString; |
- if (!this.isPrintPreview_) |
- this.progressBar_.style.visibility = 'visible'; |
- } |
- this.errorScreen_.text = message.data.loadFailedString; |
- break; |
case 'cancelStreamUrl': |
chrome.mimeHandlerPrivate.abortStream(); |
break; |