| 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 enableSiteSettings_: { |
| 31 type: Boolean, |
| 32 value: function() { |
| 33 return loadTimeData.getBoolean('enableSiteSettings'); |
| 34 }, |
| 35 }, |
| 36 |
| 29 /** | 37 /** |
| 30 * The site that was selected by the user in the dropdown list. | 38 * The site that was selected by the user in the dropdown list. |
| 31 * @type {SiteException} | 39 * @type {SiteException} |
| 32 */ | 40 */ |
| 33 selectedSite: { | 41 selectedSite: { |
| 34 type: Object, | 42 type: Object, |
| 35 notify: true, | 43 notify: true, |
| 36 }, | 44 }, |
| 37 | 45 |
| 38 /** | 46 /** |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 return false; | 419 return false; |
| 412 | 420 |
| 413 return this.showSessionOnlyAction_; | 421 return this.showSessionOnlyAction_; |
| 414 }, | 422 }, |
| 415 | 423 |
| 416 /** | 424 /** |
| 417 * A handler for selecting a site (by clicking on the origin). | 425 * A handler for selecting a site (by clicking on the origin). |
| 418 * @private | 426 * @private |
| 419 */ | 427 */ |
| 420 onOriginTap_: function(event) { | 428 onOriginTap_: function(event) { |
| 429 if (!this.enableSiteSettings_) |
| 430 return; |
| 421 this.selectedSite = event.model.item; | 431 this.selectedSite = event.model.item; |
| 422 settings.navigateTo(settings.Route.SITE_SETTINGS_SITE_DETAILS, | 432 settings.navigateTo(settings.Route.SITE_SETTINGS_SITE_DETAILS, |
| 423 new URLSearchParams('site=' + this.selectedSite.origin)); | 433 new URLSearchParams('site=' + this.selectedSite.origin)); |
| 424 }, | 434 }, |
| 425 | 435 |
| 426 /** | 436 /** |
| 427 * A handler for activating one of the menu action items. | 437 * A handler for activating one of the menu action items. |
| 428 * @param {!{model: !{item: !{origin: string}}}} event | 438 * @param {!{model: !{item: !{origin: string}}}} event |
| 429 * @param {string} action The permission to set (Allow, Block, SessionOnly, | 439 * @param {string} action The permission to set (Allow, Block, SessionOnly, |
| 430 * etc). | 440 * 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. | 543 // is redundant to also list all the sites that are blocked. |
| 534 if (this.isAllowList_()) | 544 if (this.isAllowList_()) |
| 535 return true; | 545 return true; |
| 536 | 546 |
| 537 if (this.isSessionOnlyList_()) | 547 if (this.isSessionOnlyList_()) |
| 538 return siteList.length > 0; | 548 return siteList.length > 0; |
| 539 | 549 |
| 540 return toggleState; | 550 return toggleState; |
| 541 }, | 551 }, |
| 542 }); | 552 }); |
| OLD | NEW |