| 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 var localStrings = new LocalStrings(templateData); | 7 var localStrings = new LocalStrings(templateData); |
| 8 | 8 |
| 9 <include src="component.js"/> | 9 <include src="component.js"/> |
| 10 <include src="print_preview_focus_manager.js"/> |
| 10 | 11 |
| 11 cr.define('print_preview', function() { | 12 cr.define('print_preview', function() { |
| 12 'use strict'; | 13 'use strict'; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * Container class for Chromium's print preview. | 16 * Container class for Chromium's print preview. |
| 16 * @constructor | 17 * @constructor |
| 17 * @extends {print_preview.Component} | 18 * @extends {print_preview.Component} |
| 18 */ | 19 */ |
| 19 function PrintPreview() { | 20 function PrintPreview() { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 __proto__: print_preview.Component.prototype, | 249 __proto__: print_preview.Component.prototype, |
| 249 | 250 |
| 250 /** Sets up the page and print preview by getting the printer list. */ | 251 /** Sets up the page and print preview by getting the printer list. */ |
| 251 initialize: function() { | 252 initialize: function() { |
| 252 this.decorate($('print-preview')); | 253 this.decorate($('print-preview')); |
| 253 i18nTemplate.process(document, templateData); | 254 i18nTemplate.process(document, templateData); |
| 254 if (!this.previewArea_.hasCompatiblePlugin) { | 255 if (!this.previewArea_.hasCompatiblePlugin) { |
| 255 this.setIsEnabled_(false); | 256 this.setIsEnabled_(false); |
| 256 } | 257 } |
| 257 this.nativeLayer_.startGetInitialSettings(); | 258 this.nativeLayer_.startGetInitialSettings(); |
| 259 print_preview.PrintPreviewFocusManager.getInstance().initialize(); |
| 258 cr.ui.FocusOutlineManager.forDocument(document); | 260 cr.ui.FocusOutlineManager.forDocument(document); |
| 259 }, | 261 }, |
| 260 | 262 |
| 261 /** @override */ | 263 /** @override */ |
| 262 enterDocument: function() { | 264 enterDocument: function() { |
| 263 // Native layer events. | 265 // Native layer events. |
| 264 this.tracker.add( | 266 this.tracker.add( |
| 265 this.nativeLayer_, | 267 this.nativeLayer_, |
| 266 print_preview.NativeLayer.EventType.INITIAL_SETTINGS_SET, | 268 print_preview.NativeLayer.EventType.INITIAL_SETTINGS_SET, |
| 267 this.onInitialSettingsSet_.bind(this)); | 269 this.onInitialSettingsSet_.bind(this)); |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 <include src="search/recent_destination_list.js"/> | 1188 <include src="search/recent_destination_list.js"/> |
| 1187 <include src="search/destination_list_item.js"/> | 1189 <include src="search/destination_list_item.js"/> |
| 1188 <include src="search/destination_search.js"/> | 1190 <include src="search/destination_search.js"/> |
| 1189 <include src="search/search_box.js"/> | 1191 <include src="search/search_box.js"/> |
| 1190 <include src="search/fedex_tos.js"/> | 1192 <include src="search/fedex_tos.js"/> |
| 1191 | 1193 |
| 1192 window.addEventListener('DOMContentLoaded', function() { | 1194 window.addEventListener('DOMContentLoaded', function() { |
| 1193 printPreview = new print_preview.PrintPreview(); | 1195 printPreview = new print_preview.PrintPreview(); |
| 1194 printPreview.initialize(); | 1196 printPreview.initialize(); |
| 1195 }); | 1197 }); |
| OLD | NEW |