Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/resources/print_preview/native_layer.js

Issue 10971003: Moves HTTP POST handling to JS. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 'marginRight': customMargins.get(orientationEnum.RIGHT), 253 'marginRight': customMargins.get(orientationEnum.RIGHT),
254 'marginBottom': customMargins.get(orientationEnum.BOTTOM), 254 'marginBottom': customMargins.get(orientationEnum.BOTTOM),
255 'marginLeft': customMargins.get(orientationEnum.LEFT) 255 'marginLeft': customMargins.get(orientationEnum.LEFT)
256 }; 256 };
257 } 257 }
258 258
259 if (opt_isOpenPdfInPreview) { 259 if (opt_isOpenPdfInPreview) {
260 ticket['OpenPDFInPreview'] = true; 260 ticket['OpenPDFInPreview'] = true;
261 } 261 }
262 262
263 var cloudTicket = null; 263 chrome.send('print', [JSON.stringify(ticket)]);
264 if (!destination.isLocal) {
265 assert(cloudPrintInterface != null,
266 'Trying to print to a cloud destination but Google Cloud ' +
267 'Print integration is disabled');
268 cloudTicket = cloudPrintInterface.createPrintTicket(
269 destination, printTicketStore);
270 cloudTicket = JSON.stringify(cloudTicket);
271 }
272
273 chrome.send('print', [JSON.stringify(ticket), cloudTicket]);
274 }, 264 },
275 265
276 /** Requests that the current pending print request be cancelled. */ 266 /** Requests that the current pending print request be cancelled. */
277 startCancelPendingPrint: function() { 267 startCancelPendingPrint: function() {
278 chrome.send('cancelPendingPrintRequest'); 268 chrome.send('cancelPendingPrintRequest');
279 }, 269 },
280 270
281 /** Shows the system's native printing dialog. */ 271 /** Shows the system's native printing dialog. */
282 startShowSystemDialog: function() { 272 startShowSystemDialog: function() {
283 chrome.send('showSystemDialog'); 273 chrome.send('showSystemDialog');
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 return this.serializedAppStateStr_; 671 return this.serializedAppStateStr_;
682 } 672 }
683 }; 673 };
684 674
685 // Export 675 // Export
686 return { 676 return {
687 NativeInitialSettings: NativeInitialSettings, 677 NativeInitialSettings: NativeInitialSettings,
688 NativeLayer: NativeLayer 678 NativeLayer: NativeLayer
689 }; 679 };
690 }); 680 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698