| 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 = { |
| 11 /** | 11 /** |
| 12 * Returns whether the category default is set to enabled or not. | 12 * Returns whether the category default is set to enabled or not. |
| 13 * @param {number} category The category to check. | 13 * @param {number} category The category to check. |
| 14 * @return {boolean} True if the category default is set to enabled. | 14 * @return {boolean} True if the category default is set to enabled. |
| 15 * @protected | 15 * @protected |
| 16 */ | 16 */ |
| 17 isCategoryAllowed: function(category) { | 17 isCategoryAllowed: function(category) { |
| 18 var pref = this.getPref(this.computeCategoryPrefName(category)); | 18 var pref = this.getPref(this.computeCategoryPrefName(category)); |
| 19 | 19 |
| 20 // FullScreen is Allow vs. Ask. | 20 // FullScreen is Allow vs. Ask. |
| 21 if (category == settings.ContentSettingsTypes.FULLSCREEN) | 21 if (category == settings.ContentSettingsTypes.FULLSCREEN) |
| 22 return pref.value != settings.DefaultValues.ASK; | 22 return pref.value != settings.PermissionValues.ASK; |
| 23 | 23 |
| 24 return pref.value != settings.DefaultValues.BLOCK; | 24 return pref.value != settings.PermissionValues.BLOCK; |
| 25 }, | 25 }, |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * A utility function to compute the icon to use for the category. | 28 * A utility function to compute the icon to use for the category. |
| 29 * @param {number} category The category to show the icon for. | 29 * @param {number} category The category to show the icon for. |
| 30 * @return {string} The id of the icon for the given category. | 30 * @return {string} The id of the icon for the given category. |
| 31 * @protected | 31 * @protected |
| 32 */ | 32 */ |
| 33 computeIconForContentCategory: function(category) { | 33 computeIconForContentCategory: function(category) { |
| 34 switch (category) { | 34 switch (category) { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 loadTimeData.getString('siteSettingsBlocked'); | 181 loadTimeData.getString('siteSettingsBlocked'); |
| 182 default: | 182 default: |
| 183 assertNotReached(); | 183 assertNotReached(); |
| 184 return ''; | 184 return ''; |
| 185 } | 185 } |
| 186 }, | 186 }, |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 /** @polymerBehavior */ | 189 /** @polymerBehavior */ |
| 190 var SiteSettingsBehavior = [PrefsBehavior, SiteSettingsBehaviorImpl]; | 190 var SiteSettingsBehavior = [PrefsBehavior, SiteSettingsBehaviorImpl]; |
| OLD | NEW |