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 /** |
11 * The handler will send a policy source that is similar, but not exactly the | 11 * The handler will send a policy source that is similar, but not exactly the |
12 * same as a ControlledBy value. If the ContentSettingProvider is omitted it | 12 * same as a ControlledBy value. If the ContentSettingProvider is omitted it |
13 * should be treated as 'default'. | 13 * should be treated as 'default'. |
14 * @enum {string} | 14 * @enum {string} |
15 */ | 15 */ |
16 var ContentSettingProvider = { | 16 var ContentSettingProvider = { |
17 EXTENSION: 'extension', | 17 EXTENSION: 'extension', |
18 PREFERENCE: 'preference', | 18 PREFERENCE: 'preference', |
19 }; | 19 }; |
20 | 20 |
21 /** | 21 /** |
| 22 * The site exception information passed form the C++ handler. |
| 23 * See also: SiteException. |
22 * @typedef {{embeddingOrigin: string, | 24 * @typedef {{embeddingOrigin: string, |
23 * embeddingDisplayName: string, | 25 * embeddingDisplayName: string, |
24 * incognito: boolean, | 26 * incognito: boolean, |
25 * origin: string, | 27 * origin: string, |
26 * displayName: string, | 28 * displayName: string, |
27 * setting: string, | 29 * setting: string, |
28 * source: string}} | 30 * source: string}} |
29 */ | 31 */ |
| 32 var RawSiteException; |
| 33 |
| 34 /** |
| 35 * The site exception after it has been converted/filtered for UI use. |
| 36 * See also: RawSiteException. |
| 37 * @typedef {{category: !settings.ContentSettingsTypes, |
| 38 * embeddingOrigin: string, |
| 39 * embeddingDisplayName: string, |
| 40 * incognito: boolean, |
| 41 * origin: string, |
| 42 * displayName: string, |
| 43 * setting: string, |
| 44 * source: string}} |
| 45 */ |
30 var SiteException; | 46 var SiteException; |
31 | 47 |
32 /** | 48 /** |
33 * @typedef {{location: string, | 49 * @typedef {{location: string, |
34 * notifications: string}} | 50 * notifications: string}} |
35 */ | 51 */ |
36 var CategoryDefaultsPref; | 52 var CategoryDefaultsPref; |
37 | 53 |
38 /** | 54 /** |
39 * @typedef {{setting: string, | 55 * @typedef {{setting: string, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 /** | 129 /** |
114 * Gets the default value for a site settings category. | 130 * Gets the default value for a site settings category. |
115 * @param {string} contentType The name of the category to query. | 131 * @param {string} contentType The name of the category to query. |
116 * @return {!Promise<!DefaultContentSetting>} | 132 * @return {!Promise<!DefaultContentSetting>} |
117 */ | 133 */ |
118 getDefaultValueForContentType: function(contentType) {}, | 134 getDefaultValueForContentType: function(contentType) {}, |
119 | 135 |
120 /** | 136 /** |
121 * Gets the exceptions (site list) for a particular category. | 137 * Gets the exceptions (site list) for a particular category. |
122 * @param {string} contentType The name of the category to query. | 138 * @param {string} contentType The name of the category to query. |
123 * @return {!Promise<!Array<!SiteException>>} | 139 * @return {!Promise<!Array<!RawSiteException>>} |
124 */ | 140 */ |
125 getExceptionList: function(contentType) {}, | 141 getExceptionList: function(contentType) {}, |
126 | 142 |
127 /** | 143 /** |
128 * Gets the exception details for a particular site. | 144 * Gets the exception details for a particular site. |
129 * @param {string} site The name of the site. | 145 * @param {string} site The name of the site. |
130 * @return {!Promise<!SiteException>} | 146 * @return {!Promise<!RawSiteException>} |
131 */ | 147 */ |
132 getSiteDetails: function(site) {}, | 148 getSiteDetails: function(site) {}, |
133 | 149 |
134 /** | 150 /** |
135 * Resets the category permission for a given origin (expressed as primary | 151 * Resets the category permission for a given origin (expressed as primary |
136 * and secondary patterns). | 152 * and secondary patterns). |
137 * @param {string} primaryPattern The origin to change (primary pattern). | 153 * @param {string} primaryPattern The origin to change (primary pattern). |
138 * @param {string} secondaryPattern The embedding origin to change | 154 * @param {string} secondaryPattern The embedding origin to change |
139 * (secondary pattern). | 155 * (secondary pattern). |
140 * @param {string} contentType The name of the category to reset. | 156 * @param {string} contentType The name of the category to reset. |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 removeZoomLevel: function(host) { | 432 removeZoomLevel: function(host) { |
417 chrome.send('removeZoomLevel', [host]); | 433 chrome.send('removeZoomLevel', [host]); |
418 }, | 434 }, |
419 }; | 435 }; |
420 | 436 |
421 return { | 437 return { |
422 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, | 438 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, |
423 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, | 439 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, |
424 }; | 440 }; |
425 }); | 441 }); |
OLD | NEW |