Chromium Code Reviews| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 }, | 381 }, |
| 382 | 382 |
| 383 /** | 383 /** |
| 384 * Returns the appropriate site description to display. This can, for example, | 384 * Returns the appropriate site description to display. This can, for example, |
| 385 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a | 385 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a |
| 386 * mix of the last two). | 386 * mix of the last two). |
| 387 * @param {SiteException} item The site exception entry. | 387 * @param {SiteException} item The site exception entry. |
| 388 * @return {string} The site description. | 388 * @return {string} The site description. |
| 389 */ | 389 */ |
| 390 computeSiteDescription_: function(item) { | 390 computeSiteDescription_: function(item) { |
| 391 if (item.incognito && item.embeddingDisplayName.length > 0) { | 391 var displayName = ''; |
| 392 return loadTimeData.getStringF('embeddedIncognitoSite', | 392 if (item.embeddingOrigin) { |
| 393 item.embeddingDisplayName); | 393 displayName = loadTimeData.getStringF( |
| 394 'embeddedOnHost', this.sanitizePort(item.embeddingOrigin)); | |
| 395 } else if (this.category == settings.ContentSettingsTypes.GEOLOCATION) { | |
| 396 displayName = loadTimeData.getStringF('embeddedOnHost', '*'); | |
|
msramek
2017/06/28 19:41:33
Optional: Should we have a custom string saying "e
dschuyler
2017/06/28 21:05:38
Done.
| |
| 394 } | 397 } |
| 395 | 398 |
| 396 if (item.incognito) | 399 if (item.incognito) { |
| 400 if (displayName.length > 0) | |
| 401 return loadTimeData.getStringF('embeddedIncognitoSite', displayName); | |
| 397 return loadTimeData.getString('incognitoSite'); | 402 return loadTimeData.getString('incognitoSite'); |
| 398 return item.embeddingDisplayName; | 403 } |
| 404 return displayName; | |
| 399 }, | 405 }, |
| 400 | 406 |
| 401 /** | 407 /** |
| 402 * @param {!{model: !{item: !SiteException}}} e | 408 * @param {!{model: !{item: !SiteException}}} e |
| 403 * @private | 409 * @private |
| 404 */ | 410 */ |
| 405 onResetButtonTap_: function(e) { | 411 onResetButtonTap_: function(e) { |
| 406 this.resetPermissionForOrigin_(e.model.item); | 412 this.resetPermissionForOrigin_(e.model.item); |
| 407 }, | 413 }, |
| 408 | 414 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 422 /** @private */ | 428 /** @private */ |
| 423 closeActionMenu_: function() { | 429 closeActionMenu_: function() { |
| 424 this.actionMenuSite_ = null; | 430 this.actionMenuSite_ = null; |
| 425 this.activeDialogAnchor_ = null; | 431 this.activeDialogAnchor_ = null; |
| 426 var actionMenu = /** @type {!CrActionMenuElement} */ ( | 432 var actionMenu = /** @type {!CrActionMenuElement} */ ( |
| 427 this.$$('dialog[is=cr-action-menu]')); | 433 this.$$('dialog[is=cr-action-menu]')); |
| 428 if (actionMenu.open) | 434 if (actionMenu.open) |
| 429 actionMenu.close(); | 435 actionMenu.close(); |
| 430 }, | 436 }, |
| 431 }); | 437 }); |
| OLD | NEW |