summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/print_preview
diff options
context:
space:
mode:
authorabodenha@google.com <abodenha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-21 03:53:52 +0000
committerabodenha@google.com <abodenha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-21 03:53:52 +0000
commitebace81b184c7dd8ccb0d457fa3f7d11685b2ba4 (patch)
tree344cd6198932cae1d53d67b2fc1e39fd7900f36e /chrome/browser/resources/print_preview
parentea98a399dd19b70ca6c75b1d5aa3ed4773b749f8 (diff)
downloadchromium_src-ebace81b184c7dd8ccb0d457fa3f7d11685b2ba4.zip
chromium_src-ebace81b184c7dd8ccb0d457fa3f7d11685b2ba4.tar.gz
chromium_src-ebace81b184c7dd8ccb0d457fa3f7d11685b2ba4.tar.bz2
Merge 146438 - Sets print preview document title.
BUG=136924 TEST= Review URL: https://chromiumcodereview.appspot.com/10693159 TBR=rltoscano@google.com Review URL: https://chromiumcodereview.appspot.com/10806059 git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@147764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/print_preview')
-rw-r--r--chrome/browser/resources/print_preview/data/document_info.js6
-rw-r--r--chrome/browser/resources/print_preview/data/print_ticket_store.js3
-rw-r--r--chrome/browser/resources/print_preview/native_layer.js22
3 files changed, 30 insertions, 1 deletions
diff --git a/chrome/browser/resources/print_preview/data/document_info.js b/chrome/browser/resources/print_preview/data/document_info.js
index dd2fdcd..50f3b8f 100644
--- a/chrome/browser/resources/print_preview/data/document_info.js
+++ b/chrome/browser/resources/print_preview/data/document_info.js
@@ -46,6 +46,12 @@ cr.define('print_preview', function() {
* @type {print_preview.Margins}
*/
this.margins = null;
+
+ /**
+ * Title of document.
+ * @type {string}
+ */
+ this.title = '';
};
// Export
diff --git a/chrome/browser/resources/print_preview/data/print_ticket_store.js b/chrome/browser/resources/print_preview/data/print_ticket_store.js
index 7f3a917..b9e2e4a 100644
--- a/chrome/browser/resources/print_preview/data/print_ticket_store.js
+++ b/chrome/browser/resources/print_preview/data/print_ticket_store.js
@@ -250,6 +250,7 @@ cr.define('print_preview', function() {
* Initializes the print ticket store. Dispatches an INITIALIZE event.
* @param {boolean} isDocumentModifiable Whether the document to print is
* modifiable (i.e. can be re-flowed by Chromium).
+ * @param {string} documentTitle Title of the document to print.
* @param {?boolean} isDuplexEnabled Previous duplex setting.
* @param {?boolean} isHeaderFooterEnabled Previous header-footer setting.
* @param {print_preview.ticket_items.MarginsType.Value} marginsType
@@ -262,6 +263,7 @@ cr.define('print_preview', function() {
*/
initialize: function(
isDocumentModifiable,
+ documentTitle,
isDuplexEnabled,
isHeaderFooterEnabled,
marginsType,
@@ -271,6 +273,7 @@ cr.define('print_preview', function() {
unitType) {
this.documentInfo_.isModifiable = isDocumentModifiable;
+ this.documentInfo_.title = documentTitle;
this.measurementSystem_.setSystem(
thousandsDelimeter, decimalDelimeter, unitType);
diff --git a/chrome/browser/resources/print_preview/native_layer.js b/chrome/browser/resources/print_preview/native_layer.js
index 712bf42..cc9c1c99 100644
--- a/chrome/browser/resources/print_preview/native_layer.js
+++ b/chrome/browser/resources/print_preview/native_layer.js
@@ -134,7 +134,7 @@ cr.define('print_preview', function() {
printTicketStore.getPageNumberSet().getPageRanges() : [];
var ticket = {
- 'pageRange': pageRanges, // pageRanges,
+ 'pageRange': pageRanges,
'landscape': printTicketStore.isLandscapeEnabled(),
'color': printTicketStore.isColorEnabled() ?
NativeLayer.ColorMode_.COLOR : NativeLayer.ColorMode_.GRAY,
@@ -161,6 +161,11 @@ cr.define('print_preview', function() {
'collate': printTicketStore.isCollateEnabled()
};
+ // Set 'cloudPrintID' only if the destination is not local.
+ if (!destination.isLocal) {
+ ticket['cloudPrintID'] = destination.id;
+ }
+
if (printTicketStore.hasMarginsCapability() &&
printTicketStore.getMarginsType() ==
print_preview.ticket_items.MarginsType.Value.CUSTOM) {
@@ -354,6 +359,7 @@ cr.define('print_preview', function() {
numberFormatSymbols[1] || '.',
unitType,
initialSettings['previewModifiable'] || false,
+ initialSettings['initiatorTabTitle'] || '',
marginsType,
customMargins,
initialSettings['duplex'] || false,
@@ -570,6 +576,7 @@ cr.define('print_preview', function() {
* local machine's measurement system.
* @param {boolean} isDocumentModifiable Whether the document to print is
* modifiable.
+ * @param {string} documentTitle Title of the document.
* @param {print_preview.ticket_items.MarginsType.Value} marginsType Initial
* margins type.
* @param {print_preview.Margins} customMargins Initial custom margins.
@@ -586,6 +593,7 @@ cr.define('print_preview', function() {
decimalDelimeter,
unitType,
isDocumentModifiable,
+ documentTitle,
marginsType,
customMargins,
isDuplexEnabled,
@@ -628,6 +636,13 @@ cr.define('print_preview', function() {
this.isDocumentModifiable_ = isDocumentModifiable;
/**
+ * Title of the document.
+ * @type {string}
+ * @private
+ */
+ this.documentTitle_ = documentTitle;
+
+ /**
* Initial margins type.
* @type {print_preview.ticket_items.MarginsType.Value}
* @private
@@ -694,6 +709,11 @@ cr.define('print_preview', function() {
return this.isDocumentModifiable_;
},
+ /** @return {string} Document title. */
+ get documentTitle() {
+ return this.documentTitle_;
+ },
+
/**
* @return {print_preview.ticket_items.MarginsType.Value} Initial margins
* type or {@code null} if not initially set.