| 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 * Component that renders a destination item in a destination list. | 9 * Component that renders a destination item in a destination list. |
| 10 * @param {!cr.EventTarget} eventTarget Event target to dispatch selection | 10 * @param {!cr.EventTarget} eventTarget Event target to dispatch selection |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 .classList.toggle('jumping-dots', show); | 259 .classList.toggle('jumping-dots', show); |
| 260 }, | 260 }, |
| 261 | 261 |
| 262 /** | 262 /** |
| 263 * Called when the destination item is activated. Check if the printer needs | 263 * Called when the destination item is activated. Check if the printer needs |
| 264 * to be set up first before activation. | 264 * to be set up first before activation. |
| 265 * @private | 265 * @private |
| 266 */ | 266 */ |
| 267 onActivate_: function() { | 267 onActivate_: function() { |
| 268 if (!cr.isChromeOS) { | 268 if (!cr.isChromeOS) { |
| 269 onDestinationActivated_(); | 269 this.onDestinationActivated_(); |
| 270 return; | 270 return; |
| 271 } | 271 } |
| 272 | 272 |
| 273 // Check if the printer needs configuration before using. The user is only | 273 // Check if the printer needs configuration before using. The user is only |
| 274 // allowed to set up one printer at one time. | 274 // allowed to set up one printer at one time. |
| 275 var configureEvent = new CustomEvent( | 275 var configureEvent = new CustomEvent( |
| 276 DestinationListItem.EventType.CONFIGURE_REQUEST, | 276 DestinationListItem.EventType.CONFIGURE_REQUEST, |
| 277 {detail: {destination: this.destination_}}); | 277 {detail: {destination: this.destination_}}); |
| 278 this.eventTarget_.dispatchEvent(configureEvent); | 278 this.eventTarget_.dispatchEvent(configureEvent); |
| 279 }, | 279 }, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 return; | 371 return; |
| 372 this.onExtensionIconClicked_(event); | 372 this.onExtensionIconClicked_(event); |
| 373 } | 373 } |
| 374 }; | 374 }; |
| 375 | 375 |
| 376 // Export | 376 // Export |
| 377 return { | 377 return { |
| 378 DestinationListItem: DestinationListItem | 378 DestinationListItem: DestinationListItem |
| 379 }; | 379 }; |
| 380 }); | 380 }); |
| OLD | NEW |