| 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 * Enumeration mapping all possible controlled-by values for exceptions to | 6 * Enumeration mapping all possible controlled-by values for exceptions to |
| 7 * icons. | 7 * icons. |
| 8 * @enum {string} | 8 * @enum {string} |
| 9 */ | 9 */ |
| 10 var iconControlledBy = { | 10 var iconControlledBy = { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 onSessionOnlyTap_: function(event) { | 467 onSessionOnlyTap_: function(event) { |
| 468 this.onActionMenuActivate_(event, settings.PermissionValues.SESSION_ONLY); | 468 this.onActionMenuActivate_(event, settings.PermissionValues.SESSION_ONLY); |
| 469 }, | 469 }, |
| 470 | 470 |
| 471 /** @private */ | 471 /** @private */ |
| 472 onResetTap_: function(event) { | 472 onResetTap_: function(event) { |
| 473 this.onActionMenuActivate_(event, settings.PermissionValues.DEFAULT); | 473 this.onActionMenuActivate_(event, settings.PermissionValues.DEFAULT); |
| 474 }, | 474 }, |
| 475 | 475 |
| 476 /** | 476 /** |
| 477 * Returns the appropriate header value for display. | |
| 478 * @param {Array<string>} siteList The list of all sites to display for this | |
| 479 * category subtype. | |
| 480 * @param {boolean} toggleState The state of the global toggle for this | |
| 481 * category. | |
| 482 * @private | |
| 483 */ | |
| 484 computeSiteListHeader_: function(siteList, toggleState) { | |
| 485 var title = ''; | |
| 486 if (this.categorySubtype == settings.PermissionValues.ALLOW) { | |
| 487 title = loadTimeData.getString( | |
| 488 toggleState ? 'siteSettingsAllow' : 'siteSettingsExceptions'); | |
| 489 } else if (this.categorySubtype == settings.PermissionValues.BLOCK) { | |
| 490 title = loadTimeData.getString('siteSettingsBlock'); | |
| 491 } else if (this.categorySubtype == settings.PermissionValues.SESSION_ONLY) { | |
| 492 title = loadTimeData.getString('siteSettingsSessionOnly'); | |
| 493 } else { | |
| 494 return title; | |
| 495 } | |
| 496 return loadTimeData.getStringF('titleAndCount', title, siteList.length); | |
| 497 }, | |
| 498 | |
| 499 /** | |
| 500 * Returns the appropriate site description to display. This can, for example, | 477 * Returns the appropriate site description to display. This can, for example, |
| 501 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a | 478 * be blank, an 'embedded on <site>' or 'Current incognito session' (or a |
| 502 * mix of the last two). | 479 * mix of the last two). |
| 503 * @param {SiteException} item The site exception entry. | 480 * @param {SiteException} item The site exception entry. |
| 504 * @return {string} The site description. | 481 * @return {string} The site description. |
| 505 */ | 482 */ |
| 506 computeSiteDescription_: function(item) { | 483 computeSiteDescription_: function(item) { |
| 507 if (item.incognito && item.embeddingOriginForDisplay.length > 0) { | 484 if (item.incognito && item.embeddingOriginForDisplay.length > 0) { |
| 508 return loadTimeData.getStringF('embeddedIncognitoSite', | 485 return loadTimeData.getStringF('embeddedIncognitoSite', |
| 509 item.embeddingOriginForDisplay); | 486 item.embeddingOriginForDisplay); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // is redundant to also list all the sites that are blocked. | 520 // is redundant to also list all the sites that are blocked. |
| 544 if (this.isAllowList_()) | 521 if (this.isAllowList_()) |
| 545 return true; | 522 return true; |
| 546 | 523 |
| 547 if (this.isSessionOnlyList_()) | 524 if (this.isSessionOnlyList_()) |
| 548 return siteList.length > 0; | 525 return siteList.length > 0; |
| 549 | 526 |
| 550 return toggleState; | 527 return toggleState; |
| 551 }, | 528 }, |
| 552 }); | 529 }); |
| OLD | NEW |