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 // 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 * @private | 77 * @private |
78 */ | 78 */ |
79 this.documentInfo_ = new print_preview.DocumentInfo(); | 79 this.documentInfo_ = new print_preview.DocumentInfo(); |
80 | 80 |
81 /** | 81 /** |
82 * Data store which holds print destinations. | 82 * Data store which holds print destinations. |
83 * @type {!print_preview.DestinationStore} | 83 * @type {!print_preview.DestinationStore} |
84 * @private | 84 * @private |
85 */ | 85 */ |
86 this.destinationStore_ = new print_preview.DestinationStore( | 86 this.destinationStore_ = new print_preview.DestinationStore( |
87 this.nativeLayer_, this.userInfo_, this.appState_); | 87 this.nativeLayer_, this.userInfo_, this.appState_, |
| 88 this.listenerTracker); |
88 | 89 |
89 /** | 90 /** |
90 * Data store which holds printer sharing invitations. | 91 * Data store which holds printer sharing invitations. |
91 * @type {!print_preview.InvitationStore} | 92 * @type {!print_preview.InvitationStore} |
92 * @private | 93 * @private |
93 */ | 94 */ |
94 this.invitationStore_ = new print_preview.InvitationStore(this.userInfo_); | 95 this.invitationStore_ = new print_preview.InvitationStore(this.userInfo_); |
95 | 96 |
96 /** | 97 /** |
97 * Storage of the print ticket used to create the print job. | 98 * Storage of the print ticket used to create the print job. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 initialize: function() { | 333 initialize: function() { |
333 this.decorate($('print-preview')); | 334 this.decorate($('print-preview')); |
334 if (!this.previewArea_.hasCompatiblePlugin) { | 335 if (!this.previewArea_.hasCompatiblePlugin) { |
335 this.setIsEnabled_(false); | 336 this.setIsEnabled_(false); |
336 } | 337 } |
337 this.nativeLayer_.getInitialSettings().then( | 338 this.nativeLayer_.getInitialSettings().then( |
338 this.onInitialSettingsSet_.bind(this)); | 339 this.onInitialSettingsSet_.bind(this)); |
339 print_preview.PrintPreviewFocusManager.getInstance().initialize(); | 340 print_preview.PrintPreviewFocusManager.getInstance().initialize(); |
340 cr.ui.FocusOutlineManager.forDocument(document); | 341 cr.ui.FocusOutlineManager.forDocument(document); |
341 this.listenerTracker.add('print-failed', this.onPrintFailed_.bind(this)); | 342 this.listenerTracker.add('print-failed', this.onPrintFailed_.bind(this)); |
342 this.destinationStore_.addWebUIEventListeners(this.listenerTracker); | |
343 this.listenerTracker.add( | 343 this.listenerTracker.add( |
344 'use-cloud-print', this.onCloudPrintEnable_.bind(this)); | 344 'use-cloud-print', this.onCloudPrintEnable_.bind(this)); |
345 this.listenerTracker.add( | 345 this.listenerTracker.add( |
346 'print-preset-options', | 346 'print-preset-options', |
347 this.onPrintPresetOptionsFromDocument_.bind(this)); | 347 this.onPrintPresetOptionsFromDocument_.bind(this)); |
348 this.listenerTracker.add( | 348 this.listenerTracker.add( |
349 'preview-page-count', this.onPageCountReady_.bind(this)); | 349 'preview-page-count', this.onPageCountReady_.bind(this)); |
350 this.listenerTracker.add( | 350 this.listenerTracker.add( |
351 'enable-manipulate-settings-for-test', | 351 'enable-manipulate-settings-for-test', |
352 this.onEnableManipulateSettingsForTest_.bind(this)); | 352 this.onEnableManipulateSettingsForTest_.bind(this)); |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 // <include src="search/destination_search.js"> | 1369 // <include src="search/destination_search.js"> |
1370 // <include src="search/provisional_destination_resolver.js"> | 1370 // <include src="search/provisional_destination_resolver.js"> |
1371 | 1371 |
1372 window.addEventListener('DOMContentLoaded', function() { | 1372 window.addEventListener('DOMContentLoaded', function() { |
1373 var previewWindow = /** @type {{isTest: boolean}} */ (window); | 1373 var previewWindow = /** @type {{isTest: boolean}} */ (window); |
1374 if (!previewWindow.isTest) { | 1374 if (!previewWindow.isTest) { |
1375 var printPreview = new print_preview.PrintPreview(); | 1375 var printPreview = new print_preview.PrintPreview(); |
1376 printPreview.initialize(); | 1376 printPreview.initialize(); |
1377 } | 1377 } |
1378 }); | 1378 }); |
OLD | NEW |