| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 A helper object used from the "Site Settings" section to | 6 * @fileoverview A helper object used from the "Site Settings" section to |
| 7 * interact with the content settings prefs. | 7 * interact with the content settings prefs. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 * Sets the category permission for a given origin (expressed as primary | 75 * Sets the category permission for a given origin (expressed as primary |
| 76 * and secondary patterns). | 76 * and secondary patterns). |
| 77 * @param {string} primaryPattern The origin to change (primary pattern). | 77 * @param {string} primaryPattern The origin to change (primary pattern). |
| 78 * @param {string} secondaryPattern The embedding origin to change | 78 * @param {string} secondaryPattern The embedding origin to change |
| 79 * (secondary pattern). | 79 * (secondary pattern). |
| 80 * @param {number} contentType The category to change. | 80 * @param {number} contentType The category to change. |
| 81 * @param {string} value The value to change the permission to. | 81 * @param {string} value The value to change the permission to. |
| 82 */ | 82 */ |
| 83 setCategoryPermissionForOrigin: function( | 83 setCategoryPermissionForOrigin: function( |
| 84 primaryPattern, secondaryPattern, contentType, value) {}, | 84 primaryPattern, secondaryPattern, contentType, value) {}, |
| 85 |
| 86 /** |
| 87 * Checks whether a pattern is valid. |
| 88 * @param {string} pattern The pattern to check |
| 89 * @return {!Promise<boolean>} True if the pattern is valid. |
| 90 */ |
| 91 isPatternValid: function(pattern) {}, |
| 85 }; | 92 }; |
| 86 | 93 |
| 87 /** | 94 /** |
| 88 * @constructor | 95 * @constructor |
| 89 * @implements {SiteSettingsPrefsBrowserProxy} | 96 * @implements {SiteSettingsPrefsBrowserProxy} |
| 90 */ | 97 */ |
| 91 function SiteSettingsPrefsBrowserProxyImpl() {} | 98 function SiteSettingsPrefsBrowserProxyImpl() {} |
| 92 | 99 |
| 93 // The singleton instance_ is replaced with a test version of this wrapper | 100 // The singleton instance_ is replaced with a test version of this wrapper |
| 94 // during testing. | 101 // during testing. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 116 chrome.send('resetCategoryPermissionForOrigin', | 123 chrome.send('resetCategoryPermissionForOrigin', |
| 117 [primaryPattern, secondaryPattern, contentType]); | 124 [primaryPattern, secondaryPattern, contentType]); |
| 118 }, | 125 }, |
| 119 | 126 |
| 120 /** @override */ | 127 /** @override */ |
| 121 setCategoryPermissionForOrigin: function( | 128 setCategoryPermissionForOrigin: function( |
| 122 primaryPattern, secondaryPattern, contentType, value) { | 129 primaryPattern, secondaryPattern, contentType, value) { |
| 123 chrome.send('setCategoryPermissionForOrigin', | 130 chrome.send('setCategoryPermissionForOrigin', |
| 124 [primaryPattern, secondaryPattern, contentType, value]); | 131 [primaryPattern, secondaryPattern, contentType, value]); |
| 125 }, | 132 }, |
| 133 |
| 134 /** @override */ |
| 135 isPatternValid: function(pattern) { |
| 136 return cr.sendWithPromise('isPatternValid', pattern); |
| 137 }, |
| 138 |
| 126 }; | 139 }; |
| 127 | 140 |
| 128 return { | 141 return { |
| 129 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, | 142 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, |
| 130 }; | 143 }; |
| 131 }); | 144 }); |
| OLD | NEW |