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 /** | 5 /** |
6 * The overlay displaying the image. | 6 * The overlay displaying the image. |
7 * @param {HTMLElement} container The container element. | 7 * @param {HTMLElement} container The container element. |
8 * @param {Viewport} viewport The viewport. | 8 * @param {Viewport} viewport The viewport. |
9 * @param {MetadataCache} metadataCache The metadataCache. | 9 * @param {MetadataCache} metadataCache The metadataCache. |
10 */ | 10 */ |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 this.contentCache_.renameItem(this.contentID_, newUrl); | 488 this.contentCache_.renameItem(this.contentID_, newUrl); |
489 this.screenCache_.renameItem(this.contentID_, newUrl); | 489 this.screenCache_.renameItem(this.contentID_, newUrl); |
490 this.contentID_ = newUrl; | 490 this.contentID_ = newUrl; |
491 }; | 491 }; |
492 | 492 |
493 /** | 493 /** |
494 * Unload content. | 494 * Unload content. |
495 */ | 495 */ |
496 ImageView.prototype.unload = function() { | 496 ImageView.prototype.unload = function() { |
497 this.container_.textContent = ''; | 497 this.container_.textContent = ''; |
| 498 this.contentCanvas_ = null; |
498 this.screenImage_ = null; | 499 this.screenImage_ = null; |
499 this.videoElement_ = null; | 500 this.videoElement_ = null; |
500 }; | 501 }; |
501 | 502 |
502 /** | 503 /** |
503 * | 504 * |
504 * @param {HTMLCanvasElement|HTMLVideoElement} content The image element. | 505 * @param {HTMLCanvasElement|HTMLVideoElement} content The image element. |
505 * @param {boolean} opt_reuseScreenCanvas True if it is OK to reuse the screen | 506 * @param {boolean} opt_reuseScreenCanvas True if it is OK to reuse the screen |
506 * resolution canvas. | 507 * resolution canvas. |
507 * @param {number} opt_width Image width. | 508 * @param {number} opt_width Image width. |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 return; // No need to rename. | 833 return; // No need to rename. |
833 | 834 |
834 var pos = this.order_.indexOf(oldId); | 835 var pos = this.order_.indexOf(oldId); |
835 if (pos < 0) | 836 if (pos < 0) |
836 return; // Not cached. | 837 return; // Not cached. |
837 | 838 |
838 this.order_[pos] = newId; | 839 this.order_[pos] = newId; |
839 this.map_[newId] = this.map_[oldId]; | 840 this.map_[newId] = this.map_[oldId]; |
840 delete this.map_[oldId]; | 841 delete this.map_[oldId]; |
841 }; | 842 }; |
OLD | NEW |