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 * 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 = { |
| 11 'extension': 'cr:extension', | 11 'extension': 'cr:extension', |
| 12 'HostedApp': 'cr:extension', | 12 'HostedApp': 'cr:extension', |
| 13 'platform_app': 'cr:extension', | 13 'platform_app': 'cr:extension', |
| 14 'policy' : 'cr:domain', | 14 'policy' : 'cr:domain', |
| 15 }; | 15 }; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * @fileoverview | 18 * @fileoverview |
| 19 * 'site-list' shows a list of Allowed and Blocked sites for a given | 19 * 'site-list' shows a list of Allowed and Blocked sites for a given |
| 20 * category. | 20 * category. |
| 21 */ | 21 */ |
| 22 Polymer({ | 22 Polymer({ |
| 23 | 23 |
| 24 is: 'site-list', | 24 is: 'site-list', |
| 25 | 25 |
| 26 behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], | 26 behaviors: [SiteSettingsBehavior, WebUIListenerBehavior], |
| 27 | 27 |
| 28 properties: { | 28 properties: { |
| 29 /** @private */ | |
| 30 enableAllSitesAndDetails_: Boolean, | |
|
Dan Beam
2016/10/12 17:54:05
enableAllSitesAndDetails_: {
type: Boolean,
va
dschuyler
2016/10/13 01:23:07
Done.
| |
| 31 | |
| 29 /** | 32 /** |
| 30 * The site that was selected by the user in the dropdown list. | 33 * The site that was selected by the user in the dropdown list. |
| 31 * @type {SiteException} | 34 * @type {SiteException} |
| 32 */ | 35 */ |
| 33 selectedSite: { | 36 selectedSite: { |
| 34 type: Object, | 37 type: Object, |
| 35 notify: true, | 38 notify: true, |
| 36 }, | 39 }, |
| 37 | 40 |
| 38 /** | 41 /** |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 SESSION_ONLY: 'SessionOnly', | 113 SESSION_ONLY: 'SessionOnly', |
| 111 } | 114 } |
| 112 }, | 115 }, |
| 113 }, | 116 }, |
| 114 | 117 |
| 115 observers: [ | 118 observers: [ |
| 116 'configureWidget_(category, categorySubtype, categoryEnabled, allSites)' | 119 'configureWidget_(category, categorySubtype, categoryEnabled, allSites)' |
| 117 ], | 120 ], |
| 118 | 121 |
| 119 ready: function() { | 122 ready: function() { |
| 123 this.enableAllSitesAndDetails_ = loadTimeData.getString( | |
| 124 'enableSiteSettingsAllSitesAndDetails'); | |
| 120 this.addWebUIListener('contentSettingSitePermissionChanged', | 125 this.addWebUIListener('contentSettingSitePermissionChanged', |
| 121 this.siteWithinCategoryChanged_.bind(this)); | 126 this.siteWithinCategoryChanged_.bind(this)); |
| 122 this.addWebUIListener('onIncognitoStatusChanged', | 127 this.addWebUIListener('onIncognitoStatusChanged', |
| 123 this.onIncognitoStatusChanged_.bind(this)); | 128 this.onIncognitoStatusChanged_.bind(this)); |
| 124 }, | 129 }, |
| 125 | 130 |
| 126 /** | 131 /** |
| 127 * Called when a site changes permission. | 132 * Called when a site changes permission. |
| 128 * @param {string} category The category of the site that changed. | 133 * @param {string} category The category of the site that changed. |
| 129 * @param {string} site The site that changed. | 134 * @param {string} site The site that changed. |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 return false; | 416 return false; |
| 412 | 417 |
| 413 return this.showSessionOnlyAction_; | 418 return this.showSessionOnlyAction_; |
| 414 }, | 419 }, |
| 415 | 420 |
| 416 /** | 421 /** |
| 417 * A handler for selecting a site (by clicking on the origin). | 422 * A handler for selecting a site (by clicking on the origin). |
| 418 * @private | 423 * @private |
| 419 */ | 424 */ |
| 420 onOriginTap_: function(event) { | 425 onOriginTap_: function(event) { |
| 426 if (!this.enableAllSitesAndDetails_) | |
| 427 return; | |
| 421 this.selectedSite = event.model.item; | 428 this.selectedSite = event.model.item; |
| 422 settings.navigateTo(settings.Route.SITE_SETTINGS_SITE_DETAILS, | 429 settings.navigateTo(settings.Route.SITE_SETTINGS_SITE_DETAILS, |
| 423 new URLSearchParams('site=' + this.selectedSite.origin)); | 430 new URLSearchParams('site=' + this.selectedSite.origin)); |
| 424 }, | 431 }, |
| 425 | 432 |
| 426 /** | 433 /** |
| 427 * A handler for activating one of the menu action items. | 434 * A handler for activating one of the menu action items. |
| 428 * @param {!{model: !{item: !{origin: string}}}} event | 435 * @param {!{model: !{item: !{origin: string}}}} event |
| 429 * @param {string} action The permission to set (Allow, Block, SessionOnly, | 436 * @param {string} action The permission to set (Allow, Block, SessionOnly, |
| 430 * etc). | 437 * etc). |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 // is redundant to also list all the sites that are blocked. | 540 // is redundant to also list all the sites that are blocked. |
| 534 if (this.isAllowList_()) | 541 if (this.isAllowList_()) |
| 535 return true; | 542 return true; |
| 536 | 543 |
| 537 if (this.isSessionOnlyList_()) | 544 if (this.isSessionOnlyList_()) |
| 538 return siteList.length > 0; | 545 return siteList.length > 0; |
| 539 | 546 |
| 540 return toggleState; | 547 return toggleState; |
| 541 }, | 548 }, |
| 542 }); | 549 }); |
| OLD | NEW |