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 * @constructor | 10 * @constructor |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 var icon = this.document_.createElement('div'); | 275 var icon = this.document_.createElement('div'); |
276 icon.className = 'gdrive-icon'; | 276 icon.className = 'gdrive-icon'; |
277 box.appendChild(icon); | 277 box.appendChild(icon); |
278 | 278 |
279 var text = this.document_.createElement('div'); | 279 var text = this.document_.createElement('div'); |
280 text.className = 'gdrive-text'; | 280 text.className = 'gdrive-text'; |
281 text.textContent = strf('DRIVE_SPACE_AVAILABLE_LONG', | 281 text.textContent = strf('DRIVE_SPACE_AVAILABLE_LONG', |
282 util.bytesToSi(sizeStats.remainingSizeKB * 1024)); | 282 util.bytesToSi(sizeStats.remainingSizeKB * 1024)); |
283 box.appendChild(text); | 283 box.appendChild(text); |
284 | 284 |
285 var link = this.document_.createElement('div'); | 285 var link = this.document_.createElement('a'); |
286 link.className = 'plain-link'; | 286 link.className = 'plain-link'; |
287 link.textContent = str('DRIVE_BUY_MORE_SPACE_LINK'); | 287 link.textContent = str('DRIVE_BUY_MORE_SPACE_LINK'); |
288 link.href = GOOGLE_DRIVE_BUY_STORAGE; | 288 link.href = GOOGLE_DRIVE_BUY_STORAGE; |
| 289 link.target = '_blank'; |
289 box.appendChild(link); | 290 box.appendChild(link); |
290 | 291 |
291 var close = this.document_.createElement('div'); | 292 var close = this.document_.createElement('div'); |
292 close.className = 'cr-dialog-close'; | 293 close.className = 'cr-dialog-close'; |
293 box.appendChild(close); | 294 box.appendChild(close); |
294 close.addEventListener('click', function(total) { | 295 close.addEventListener('click', function(total) { |
295 localStorage[WARNING_DISMISSED_KEY] = total; | 296 localStorage[WARNING_DISMISSED_KEY] = total; |
296 box.hidden = true; | 297 box.hidden = true; |
297 this.requestRelayout_(100); | 298 this.requestRelayout_(100); |
298 }.bind(this, sizeStats.totalSizeKB)); | 299 }.bind(this, sizeStats.totalSizeKB)); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 * this.newWelcome_ get ready. | 575 * this.newWelcome_ get ready. |
575 * @private | 576 * @private |
576 */ | 577 */ |
577 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { | 578 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { |
578 if (this.newWelcome_ !== undefined) | 579 if (this.newWelcome_ !== undefined) |
579 completeCallback(); | 580 completeCallback(); |
580 else | 581 else |
581 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); | 582 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); |
582 }; | 583 }; |
583 | 584 |
OLD | NEW |