| 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 Behavior common to Site Settings classes. | 6 * @fileoverview Behavior common to Site Settings classes. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** @polymerBehavior */ | 9 /** @polymerBehavior */ |
| 10 var SiteSettingsBehaviorImpl = { | 10 var SiteSettingsBehaviorImpl = { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 created: function() { | 26 created: function() { |
| 27 this.browserProxy = | 27 this.browserProxy = |
| 28 settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); | 28 settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 ready: function() { | 31 ready: function() { |
| 32 this.PermissionValues = settings.PermissionValues; | 32 this.PermissionValues = settings.PermissionValues; |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * A utility function to lookup a category name from its enum. Note: The | |
| 37 * category name is visible to the user as part of the URL. | |
| 38 * @param {string} category The category ID to look up. | |
| 39 * @return {string} The category found or blank string if not found. | |
| 40 * @protected | |
| 41 */ | |
| 42 computeCategoryTextId: function(category) { | |
| 43 switch (category) { | |
| 44 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS: | |
| 45 return 'automatic-downloads'; | |
| 46 case settings.ContentSettingsTypes.BACKGROUND_SYNC: | |
| 47 return 'background-sync'; | |
| 48 case settings.ContentSettingsTypes.CAMERA: | |
| 49 return 'camera'; | |
| 50 case settings.ContentSettingsTypes.COOKIES: | |
| 51 return 'cookies'; | |
| 52 case settings.ContentSettingsTypes.GEOLOCATION: | |
| 53 return 'location'; | |
| 54 case settings.ContentSettingsTypes.IMAGES: | |
| 55 return 'images'; | |
| 56 case settings.ContentSettingsTypes.JAVASCRIPT: | |
| 57 return 'javascript'; | |
| 58 case settings.ContentSettingsTypes.KEYGEN: | |
| 59 return 'keygen'; | |
| 60 case settings.ContentSettingsTypes.MIC: | |
| 61 return 'microphone'; | |
| 62 case settings.ContentSettingsTypes.NOTIFICATIONS: | |
| 63 return 'notifications'; | |
| 64 case settings.ContentSettingsTypes.PLUGINS: | |
| 65 return 'plugins'; | |
| 66 case settings.ContentSettingsTypes.POPUPS: | |
| 67 return 'popups'; | |
| 68 case settings.ContentSettingsTypes.PROTOCOL_HANDLERS: | |
| 69 return 'handlers'; | |
| 70 case settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS: | |
| 71 return 'unsandboxed-plugins'; | |
| 72 case settings.ContentSettingsTypes.USB_DEVICES: | |
| 73 return 'usb-devices'; | |
| 74 case settings.ContentSettingsTypes.ZOOM_LEVELS: | |
| 75 return 'zoom-levels'; | |
| 76 default: | |
| 77 return ''; | |
| 78 } | |
| 79 }, | |
| 80 | |
| 81 /** | |
| 82 * A utility function to lookup the route for a category name. | 36 * A utility function to lookup the route for a category name. |
| 83 * @param {string} category The category ID to look up. | 37 * @param {string} category The category ID to look up. |
| 84 * @return {!settings.Route} | 38 * @return {!settings.Route} |
| 85 * @protected | 39 * @protected |
| 86 */ | 40 */ |
| 87 computeCategoryRoute: function(category) { | 41 computeCategoryRoute: function(category) { |
| 88 switch (category) { | 42 switch (category) { |
| 89 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS: | 43 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS: |
| 90 return settings.Route.SITE_SETTINGS_AUTOMATIC_DOWNLOADS; | 44 return settings.Route.SITE_SETTINGS_AUTOMATIC_DOWNLOADS; |
| 91 case settings.ContentSettingsTypes.BACKGROUND_SYNC: | 45 case settings.ContentSettingsTypes.BACKGROUND_SYNC: |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 incognito: exception.incognito, | 455 incognito: exception.incognito, |
| 502 setting: exception.setting, | 456 setting: exception.setting, |
| 503 source: exception.source, | 457 source: exception.source, |
| 504 }; | 458 }; |
| 505 }, | 459 }, |
| 506 | 460 |
| 507 }; | 461 }; |
| 508 | 462 |
| 509 /** @polymerBehavior */ | 463 /** @polymerBehavior */ |
| 510 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; | 464 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; |
| OLD | NEW |