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 * Responsible for showing banners in the file list. | 6 * Responsible for showing banners in the file list. |
7 * @param {DirectoryModel} directoryModel The model. | 7 * @param {DirectoryModel} directoryModel The model. |
8 * @param {VolumeManager} volumeManager The manager. | 8 * @param {VolumeManager} volumeManager The manager. |
9 * @param {DOMDocument} document HTML document. | 9 * @param {DOMDocument} document HTML document. |
10 * @param {boolean} showOffers True if we should show offer banners. | 10 * @param {boolean} showOffers True if we should show offer banners. |
11 * @constructor | 11 * @constructor |
12 */ | 12 */ |
13 function FileListBannerController( | 13 function FileListBannerController( |
14 directoryModel, volumeManager, document, showOffers) { | 14 directoryModel, volumeManager, document, showOffers) { |
15 this.directoryModel_ = directoryModel; | 15 this.directoryModel_ = directoryModel; |
16 this.volumeManager_ = volumeManager; | 16 this.volumeManager_ = volumeManager; |
17 this.document_ = document; | 17 this.document_ = document; |
18 this.showOffers_ = showOffers; | 18 this.showOffers_ = showOffers; |
19 this.driveEnabled_ = false; | 19 this.driveEnabled_ = false; |
20 | 20 |
21 if (!util.boardIs('x86-mario') && | 21 if (!util.boardIs('x86-mario') && |
22 !util.boardIs('x86-zgb') && | 22 !util.boardIs('x86-zgb') && |
23 !util.boardIs('x86-alex') && | 23 !util.boardIs('x86-alex')) { |
24 !util.boardIs('stout')) { | |
25 this.checkPromoAvailable_(); | 24 this.checkPromoAvailable_(); |
26 } else { | 25 } else { |
27 this.newWelcome_ = false; | 26 this.newWelcome_ = false; |
28 } | 27 } |
29 | 28 |
30 var handler = this.checkSpaceAndShowBanner_.bind(this); | 29 var handler = this.checkSpaceAndShowBanner_.bind(this); |
31 this.directoryModel_.addEventListener('scan-completed', handler); | 30 this.directoryModel_.addEventListener('scan-completed', handler); |
32 this.directoryModel_.addEventListener('rescan-completed', handler); | 31 this.directoryModel_.addEventListener('rescan-completed', handler); |
33 this.directoryModel_.addEventListener('directory-changed', | 32 this.directoryModel_.addEventListener('directory-changed', |
34 this.onDirectoryChanged_.bind(this)); | 33 this.onDirectoryChanged_.bind(this)); |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 * @param {function} completeCallback To be called (may be directly) when | 586 * @param {function} completeCallback To be called (may be directly) when |
588 * this.newWelcome_ get ready. | 587 * this.newWelcome_ get ready. |
589 * @private | 588 * @private |
590 */ | 589 */ |
591 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { | 590 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { |
592 if (this.newWelcome_ !== undefined) | 591 if (this.newWelcome_ !== undefined) |
593 completeCallback(); | 592 completeCallback(); |
594 else | 593 else |
595 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); | 594 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); |
596 }; | 595 }; |
OLD | NEW |