| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * TODO(mtomasz): Rewrite the entire audio player. | 8 * TODO(mtomasz): Rewrite the entire audio player. |
| 9 * | 9 * |
| 10 * @param {HTMLElement} container Container element. | 10 * @param {HTMLElement} container Container element. |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // Expanded. | 461 // Expanded. |
| 462 if (this.lastExpandedHeight_) { | 462 if (this.lastExpandedHeight_) { |
| 463 targetHeight = this.lastExpandedHeight_; | 463 targetHeight = this.lastExpandedHeight_; |
| 464 } else { | 464 } else { |
| 465 var expandedListHeight = | 465 var expandedListHeight = |
| 466 Math.min(this.entries_.length, AudioPlayer.DEFAULT_EXPANDED_ITEMS) * | 466 Math.min(this.entries_.length, AudioPlayer.DEFAULT_EXPANDED_ITEMS) * |
| 467 AudioPlayer.TRACK_HEIGHT; | 467 AudioPlayer.TRACK_HEIGHT; |
| 468 targetHeight = AudioPlayer.CONTROLS_HEIGHT + expandedListHeight; | 468 targetHeight = AudioPlayer.CONTROLS_HEIGHT + expandedListHeight; |
| 469 } | 469 } |
| 470 } else { | 470 } else { |
| 471 // Not expaned. | 471 // Not expanded. |
| 472 targetHeight = AudioPlayer.CONTROLS_HEIGHT + AudioPlayer.TRACK_HEIGHT; | 472 targetHeight = AudioPlayer.CONTROLS_HEIGHT + AudioPlayer.TRACK_HEIGHT; |
| 473 } | 473 } |
| 474 | 474 |
| 475 window.resizeTo(window.innerWidth, targetHeight + AudioPlayer.HEADER_HEIGHT); | 475 window.resizeTo(window.innerWidth, targetHeight + AudioPlayer.HEADER_HEIGHT); |
| 476 }; | 476 }; |
| 477 | 477 |
| 478 /** | 478 /** |
| 479 * Create a TrackInfo object encapsulating the information about one track. | 479 * Create a TrackInfo object encapsulating the information about one track. |
| 480 * | 480 * |
| 481 * @param {HTMLElement} container Container element. | 481 * @param {HTMLElement} container Container element. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 * Restore the state after page/app reload. | 609 * Restore the state after page/app reload. |
| 610 */ | 610 */ |
| 611 FullWindowAudioControls.prototype.restorePlayState = function() { | 611 FullWindowAudioControls.prototype.restorePlayState = function() { |
| 612 if (this.restoreWhenLoaded_) { | 612 if (this.restoreWhenLoaded_) { |
| 613 this.restoreWhenLoaded_ = false; // This should only work once. | 613 this.restoreWhenLoaded_ = false; // This should only work once. |
| 614 if (this.decodeState()) | 614 if (this.decodeState()) |
| 615 return; | 615 return; |
| 616 } | 616 } |
| 617 this.play(); | 617 this.play(); |
| 618 }; | 618 }; |
| OLD | NEW |