| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * An interface to the native Chromium printing system layer. | 9 * An interface to the native Chromium printing system layer. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 /** Requests that the current pending print request be cancelled. */ | 279 /** Requests that the current pending print request be cancelled. */ |
| 280 startCancelPendingPrint: function() { | 280 startCancelPendingPrint: function() { |
| 281 chrome.send('cancelPendingPrintRequest'); | 281 chrome.send('cancelPendingPrintRequest'); |
| 282 }, | 282 }, |
| 283 | 283 |
| 284 /** Shows the system's native printing dialog. */ | 284 /** Shows the system's native printing dialog. */ |
| 285 startShowSystemDialog: function() { | 285 startShowSystemDialog: function() { |
| 286 chrome.send('showSystemDialog'); | 286 chrome.send('showSystemDialog'); |
| 287 }, | 287 }, |
| 288 | 288 |
| 289 /** Shows Google Cloud Print's web-based print dialog. */ | 289 /** Shows Google Cloud Print's web-based print dialog. |
| 290 startShowCloudPrintDialog: function() { | 290 * @param {number} pageCount Number of pages to print. |
| 291 chrome.send('printWithCloudPrint'); | 291 */ |
| 292 startShowCloudPrintDialog: function(pageCount) { |
| 293 chrome.send('printWithCloudPrintDialog', [pageCount]); |
| 292 }, | 294 }, |
| 293 | 295 |
| 294 /** Closes the print preview dialog. */ | 296 /** Closes the print preview dialog. */ |
| 295 startCloseDialog: function() { | 297 startCloseDialog: function() { |
| 296 chrome.send('closePrintPreviewDialog'); | 298 chrome.send('closePrintPreviewDialog'); |
| 297 chrome.send('DialogClose'); | 299 chrome.send('DialogClose'); |
| 298 }, | 300 }, |
| 299 | 301 |
| 300 /** Hide the print preview dialog and allow the native layer to close it. */ | 302 /** Hide the print preview dialog and allow the native layer to close it. */ |
| 301 startHideDialog: function() { | 303 startHideDialog: function() { |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 return this.serializedAppStateStr_; | 739 return this.serializedAppStateStr_; |
| 738 } | 740 } |
| 739 }; | 741 }; |
| 740 | 742 |
| 741 // Export | 743 // Export |
| 742 return { | 744 return { |
| 743 NativeInitialSettings: NativeInitialSettings, | 745 NativeInitialSettings: NativeInitialSettings, |
| 744 NativeLayer: NativeLayer | 746 NativeLayer: NativeLayer |
| 745 }; | 747 }; |
| 746 }); | 748 }); |
| OLD | NEW |