Chromium Code Reviews| Index: chrome/browser/resources/print_preview/print_preview.js |
| diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js |
| index 86459f30098d043ca06335eccde269f39e2016e4..4f44f344e22ae0726003af638609b07656a2c773 100644 |
| --- a/chrome/browser/resources/print_preview/print_preview.js |
| +++ b/chrome/browser/resources/print_preview/print_preview.js |
| @@ -137,6 +137,7 @@ function onLoad() { |
| $('printer-list').onchange = updateControlsWithSelectedPrinterCapabilities; |
| showLoadingAnimation(); |
| + chrome.send('getInitiatorTabTitle'); |
|
kmadhusu
2011/09/02 06:50:09
What will be the title if the initiator tab is clo
dpapad
2011/09/02 17:40:18
It was displaying "Print -", fixed now to display
|
| chrome.send('getDefaultPrinter'); |
| } |
| @@ -887,15 +888,12 @@ function setPluginPreviewPageCount() { |
| * modified. |
| * @param {number} previewResponseId The preview request id that resulted in |
| * this response. |
| - * @param {string} jobTitle The print job title |
| */ |
| -function onDidGetPreviewPageCount(pageCount, isModifiable, previewResponseId, |
| - jobTitle) { |
| +function onDidGetPreviewPageCount(pageCount, isModifiable, previewResponseId) { |
| if (!isExpectedPreviewResponse(previewResponseId)) |
| return; |
| pageSettings.updateState(pageCount); |
| previewModifiable = isModifiable; |
| - document.title = localStrings.getStringF('printPreviewTitleFormat', jobTitle); |
| cr.dispatchSimpleEvent(document, 'updateSummary'); |
| } |
| @@ -1073,6 +1071,17 @@ PrintSettings.prototype.save = function() { |
| this.hasHeaderFooter = headerFooterSettings.hasHeaderFooter(); |
| } |
| +/** |
| + * Updates the title of the print preview tab according to |initiatorTabTitle|. |
| + * Called from PrintPreviewUI::OnGetInitiatorTabTitle as a result of sending a |
| + * 'getInitiatorTabTitle' message. |
| + * @param {string} initiatorTabTitle The title of the initiator tab. |
| + */ |
| +function setInitiatorTabTitle(initiatorTabTitle) { |
| + document.title = localStrings.getStringF( |
| + 'printPreviewTitleFormat', initiatorTabTitle); |
| +} |
| + |
| /// Pull in all other scripts in a single shot. |
| <include src="print_preview_animations.js"/> |
| <include src="print_preview_cloud.js"/> |