OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @fileoverview | 6 * @fileoverview |
7 * 'site-list' shows a list of Allowed and Blocked sites for a given | 7 * 'site-list' shows a list of Allowed and Blocked sites for a given |
8 * category. | 8 * category. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 }, | 383 }, |
384 | 384 |
385 /** | 385 /** |
386 * Returns the appropriate site description to display. This can, for example, | 386 * Returns the appropriate site description to display. This can, for example, |
387 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a | 387 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a |
388 * mix of the last two). | 388 * mix of the last two). |
389 * @param {SiteException} item The site exception entry. | 389 * @param {SiteException} item The site exception entry. |
390 * @return {string} The site description. | 390 * @return {string} The site description. |
391 */ | 391 */ |
392 computeSiteDescription_: function(item) { | 392 computeSiteDescription_: function(item) { |
393 if (item.incognito && item.embeddingDisplayName.length > 0) { | 393 var displayName = ''; |
394 return loadTimeData.getStringF( | 394 if (item.embeddingOrigin) { |
395 'embeddedIncognitoSite', item.embeddingDisplayName); | 395 displayName = loadTimeData.getStringF( |
| 396 'embeddedOnHost', this.sanitizePort(item.embeddingOrigin)); |
| 397 } else if (this.category == settings.ContentSettingsTypes.GEOLOCATION) { |
| 398 displayName = loadTimeData.getString('embeddedOnAnyHost'); |
396 } | 399 } |
397 | 400 |
398 if (item.incognito) | 401 if (item.incognito) { |
| 402 if (displayName.length > 0) |
| 403 return loadTimeData.getStringF('embeddedIncognitoSite', displayName); |
399 return loadTimeData.getString('incognitoSite'); | 404 return loadTimeData.getString('incognitoSite'); |
400 return item.embeddingDisplayName; | 405 } |
| 406 return displayName; |
401 }, | 407 }, |
402 | 408 |
403 /** | 409 /** |
404 * @param {!{model: !{item: !SiteException}}} e | 410 * @param {!{model: !{item: !SiteException}}} e |
405 * @private | 411 * @private |
406 */ | 412 */ |
407 onResetButtonTap_: function(e) { | 413 onResetButtonTap_: function(e) { |
408 this.resetPermissionForOrigin_(e.model.item); | 414 this.resetPermissionForOrigin_(e.model.item); |
409 }, | 415 }, |
410 | 416 |
(...skipping 13 matching lines...) Expand all Loading... |
424 /** @private */ | 430 /** @private */ |
425 closeActionMenu_: function() { | 431 closeActionMenu_: function() { |
426 this.actionMenuSite_ = null; | 432 this.actionMenuSite_ = null; |
427 this.activeDialogAnchor_ = null; | 433 this.activeDialogAnchor_ = null; |
428 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 434 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
429 this.$$('dialog[is=cr-action-menu]')); | 435 this.$$('dialog[is=cr-action-menu]')); |
430 if (actionMenu.open) | 436 if (actionMenu.open) |
431 actionMenu.close(); | 437 actionMenu.close(); |
432 }, | 438 }, |
433 }); | 439 }); |
OLD | NEW |