| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 this.browserProxy.resetCategoryPermissionForOrigin( | 42 this.browserProxy.resetCategoryPermissionForOrigin( |
| 43 primaryPattern, secondaryPattern, category); | 43 primaryPattern, secondaryPattern, category); |
| 44 }, | 44 }, |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Sets the category permission for a given origin. | 47 * Sets the category permission for a given origin. |
| 48 * @param {string} primaryPattern The primary pattern to change the permission | 48 * @param {string} primaryPattern The primary pattern to change the permission |
| 49 * for. | 49 * for. |
| 50 * @param {string} secondaryPattern The secondary pattern to change the | 50 * @param {string} secondaryPattern The secondary pattern to change the |
| 51 * permission for. | 51 * permission for. |
| 52 * @param {number} value What value to set the permission to. | |
| 53 * @param {number} category The category permission to change. | 52 * @param {number} category The category permission to change. |
| 53 * @param {string} value What value to set the permission to. |
| 54 * @protected | 54 * @protected |
| 55 */ | 55 */ |
| 56 setCategoryPermissionForOrigin: function( | 56 setCategoryPermissionForOrigin: function( |
| 57 primaryPattern, secondaryPattern, value, category) { | 57 primaryPattern, secondaryPattern, category, value) { |
| 58 this.browserProxy.setCategoryPermissionForOrigin( | 58 this.browserProxy.setCategoryPermissionForOrigin( |
| 59 primaryPattern, secondaryPattern, category, value); | 59 primaryPattern, secondaryPattern, category, value); |
| 60 }, | 60 }, |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * A utility function to lookup a category name from its enum. | 63 * A utility function to lookup a category name from its enum. |
| 64 * @param {number} category The category ID to look up. | 64 * @param {number} category The category ID to look up. |
| 65 * @return {string} The category found or blank string if not found. | 65 * @return {string} The category found or blank string if not found. |
| 66 * @protected | 66 * @protected |
| 67 */ | 67 */ |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 * @return {string} The URL with a scheme, or an empty string. | 291 * @return {string} The URL with a scheme, or an empty string. |
| 292 */ | 292 */ |
| 293 ensureUrlHasScheme: function(url) { | 293 ensureUrlHasScheme: function(url) { |
| 294 if (url.length == 0) return url; | 294 if (url.length == 0) return url; |
| 295 return url.includes('://') ? url : 'http://' + url; | 295 return url.includes('://') ? url : 'http://' + url; |
| 296 }, | 296 }, |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 /** @polymerBehavior */ | 299 /** @polymerBehavior */ |
| 300 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; | 300 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; |
| OLD | NEW |