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

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

Issue 2962983002: Print Preview: change getPreview to cr.sendWithPromise (Closed)
Patch Set: Re-comment test Created 3 years, 5 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 // TODO(rltoscano): Move data/* into print_preview.data namespace 5 // TODO(rltoscano): Move data/* into print_preview.data namespace
6 6
7 // <include src="component.js"> 7 // <include src="component.js">
8 // <include src="print_preview_focus_manager.js"> 8 // <include src="print_preview_focus_manager.js">
9 // 9 //
10 10
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 /** @override */ 345 /** @override */
346 enterDocument: function() { 346 enterDocument: function() {
347 // Native layer events. 347 // Native layer events.
348 var nativeLayerEventTarget = this.nativeLayer_.getEventTarget(); 348 var nativeLayerEventTarget = this.nativeLayer_.getEventTarget();
349 this.tracker.add( 349 this.tracker.add(
350 nativeLayerEventTarget, 350 nativeLayerEventTarget,
351 print_preview.NativeLayer.EventType.CLOUD_PRINT_ENABLE, 351 print_preview.NativeLayer.EventType.CLOUD_PRINT_ENABLE,
352 this.onCloudPrintEnable_.bind(this)); 352 this.onCloudPrintEnable_.bind(this));
353 this.tracker.add( 353 this.tracker.add(
354 nativeLayerEventTarget, 354 nativeLayerEventTarget,
355 print_preview.NativeLayer.EventType.SETTINGS_INVALID,
356 this.onSettingsInvalid_.bind(this));
357 this.tracker.add(
358 nativeLayerEventTarget,
359 print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS, 355 print_preview.NativeLayer.EventType.PRINT_PRESET_OPTIONS,
360 this.onPrintPresetOptionsFromDocument_.bind(this)); 356 this.onPrintPresetOptionsFromDocument_.bind(this));
361 this.tracker.add( 357 this.tracker.add(
362 nativeLayerEventTarget, 358 nativeLayerEventTarget,
363 print_preview.NativeLayer.EventType.PAGE_COUNT_READY, 359 print_preview.NativeLayer.EventType.PAGE_COUNT_READY,
364 this.onPageCountReady_.bind(this)); 360 this.onPageCountReady_.bind(this));
365 this.tracker.add( 361 this.tracker.add(
366 nativeLayerEventTarget, 362 nativeLayerEventTarget,
367 print_preview.NativeLayer.EventType.MANIPULATE_SETTINGS_FOR_TEST, 363 print_preview.NativeLayer.EventType.MANIPULATE_SETTINGS_FOR_TEST,
368 this.onManipulateSettingsForTest_.bind(this)); 364 this.onManipulateSettingsForTest_.bind(this));
(...skipping 18 matching lines...) Expand all
387 print_preview.PreviewArea.EventType.PREVIEW_GENERATION_DONE, 383 print_preview.PreviewArea.EventType.PREVIEW_GENERATION_DONE,
388 this.onPreviewGenerationDone_.bind(this)); 384 this.onPreviewGenerationDone_.bind(this));
389 this.tracker.add( 385 this.tracker.add(
390 this.previewArea_, 386 this.previewArea_,
391 print_preview.PreviewArea.EventType.PREVIEW_GENERATION_FAIL, 387 print_preview.PreviewArea.EventType.PREVIEW_GENERATION_FAIL,
392 this.onPreviewGenerationFail_.bind(this)); 388 this.onPreviewGenerationFail_.bind(this));
393 this.tracker.add( 389 this.tracker.add(
394 this.previewArea_, 390 this.previewArea_,
395 print_preview.PreviewArea.EventType.OPEN_SYSTEM_DIALOG_CLICK, 391 print_preview.PreviewArea.EventType.OPEN_SYSTEM_DIALOG_CLICK,
396 this.openSystemPrintDialog_.bind(this)); 392 this.openSystemPrintDialog_.bind(this));
393 this.tracker.add(
394 this.previewArea_,
395 print_preview.PreviewArea.EventType.SETTINGS_INVALID,
396 this.onSettingsInvalid_.bind(this));
397 397
398 this.tracker.add( 398 this.tracker.add(
399 this.destinationStore_, 399 this.destinationStore_,
400 print_preview.DestinationStore.EventType 400 print_preview.DestinationStore.EventType
401 .SELECTED_DESTINATION_CAPABILITIES_READY, 401 .SELECTED_DESTINATION_CAPABILITIES_READY,
402 this.printIfReady_.bind(this)); 402 this.printIfReady_.bind(this));
403 this.tracker.add( 403 this.tracker.add(
404 this.destinationStore_, 404 this.destinationStore_,
405 print_preview.DestinationStore.EventType.DESTINATION_SELECT, 405 print_preview.DestinationStore.EventType.DESTINATION_SELECT,
406 this.onDestinationSelect_.bind(this)); 406 this.onDestinationSelect_.bind(this));
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 // <include src="search/destination_search.js"> 1363 // <include src="search/destination_search.js">
1364 // <include src="search/provisional_destination_resolver.js"> 1364 // <include src="search/provisional_destination_resolver.js">
1365 1365
1366 window.addEventListener('DOMContentLoaded', function() { 1366 window.addEventListener('DOMContentLoaded', function() {
1367 var previewWindow = /** @type {{isTest: boolean}} */ (window); 1367 var previewWindow = /** @type {{isTest: boolean}} */ (window);
1368 if (!previewWindow.isTest) { 1368 if (!previewWindow.isTest) {
1369 var printPreview = new print_preview.PrintPreview(); 1369 var printPreview = new print_preview.PrintPreview();
1370 printPreview.initialize(); 1370 printPreview.initialize();
1371 } 1371 }
1372 }); 1372 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698