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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 /** | 59 /** |
60 * @typedef {{embeddingOrigin: string, | 60 * @typedef {{embeddingOrigin: string, |
61 * object: UsbDeviceDetails, | 61 * object: UsbDeviceDetails, |
62 * objectName: string, | 62 * objectName: string, |
63 * origin: string, | 63 * origin: string, |
64 * setting: string, | 64 * setting: string, |
65 * source: string}} | 65 * source: string}} |
66 */ | 66 */ |
67 var UsbDeviceEntry; | 67 var UsbDeviceEntry; |
68 | 68 |
| 69 /** |
| 70 * @typedef {{origin: string, |
| 71 * setting: string, |
| 72 * source: string, |
| 73 * zoom: string}} |
| 74 */ |
| 75 var ZoomLevelEntry; |
| 76 |
69 cr.define('settings', function() { | 77 cr.define('settings', function() { |
70 /** @interface */ | 78 /** @interface */ |
71 function SiteSettingsPrefsBrowserProxy() {} | 79 function SiteSettingsPrefsBrowserProxy() {} |
72 | 80 |
73 SiteSettingsPrefsBrowserProxy.prototype = { | 81 SiteSettingsPrefsBrowserProxy.prototype = { |
74 /** | 82 /** |
75 * Sets the default value for a site settings category. | 83 * Sets the default value for a site settings category. |
76 * @param {string} contentType The name of the category to change. | 84 * @param {string} contentType The name of the category to change. |
77 * @param {string} defaultValue The name of the value to set as default. | 85 * @param {string} defaultValue The name of the value to set as default. |
78 */ | 86 */ |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 * @param {UsbDeviceDetails} usbDevice The USB device to revoke permission | 217 * @param {UsbDeviceDetails} usbDevice The USB device to revoke permission |
210 * for. | 218 * for. |
211 */ | 219 */ |
212 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) {}, | 220 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) {}, |
213 | 221 |
214 /** | 222 /** |
215 * Fetches the incognito status of the current profile (whether an icognito | 223 * Fetches the incognito status of the current profile (whether an icognito |
216 * profile exists). Returns the results via onIncognitoStatusChanged. | 224 * profile exists). Returns the results via onIncognitoStatusChanged. |
217 */ | 225 */ |
218 updateIncognitoStatus: function() {}, | 226 updateIncognitoStatus: function() {}, |
| 227 |
| 228 /** |
| 229 * Fetches the currently defined zoom levels for sites. Returns the results |
| 230 * via onZoomLevelsChanged. |
| 231 */ |
| 232 fetchZoomLevels: function() {}, |
| 233 |
| 234 /** |
| 235 * Removes a zoom levels for a given host. |
| 236 * @param {string} host The host to remove zoom levels for. |
| 237 */ |
| 238 removeZoomLevel: function(host) {}, |
219 }; | 239 }; |
220 | 240 |
221 /** | 241 /** |
222 * @constructor | 242 * @constructor |
223 * @implements {settings.SiteSettingsPrefsBrowserProxy} | 243 * @implements {settings.SiteSettingsPrefsBrowserProxy} |
224 */ | 244 */ |
225 function SiteSettingsPrefsBrowserProxyImpl() {} | 245 function SiteSettingsPrefsBrowserProxyImpl() {} |
226 | 246 |
227 // The singleton instance_ is replaced with a test version of this wrapper | 247 // The singleton instance_ is replaced with a test version of this wrapper |
228 // during testing. | 248 // during testing. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 339 |
320 /** @override */ | 340 /** @override */ |
321 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) { | 341 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) { |
322 chrome.send('removeUsbDevice', [origin, embeddingOrigin, usbDevice]); | 342 chrome.send('removeUsbDevice', [origin, embeddingOrigin, usbDevice]); |
323 }, | 343 }, |
324 | 344 |
325 /** @override */ | 345 /** @override */ |
326 updateIncognitoStatus: function() { | 346 updateIncognitoStatus: function() { |
327 chrome.send('updateIncognitoStatus'); | 347 chrome.send('updateIncognitoStatus'); |
328 }, | 348 }, |
| 349 |
| 350 /** @override */ |
| 351 fetchZoomLevels: function() { |
| 352 chrome.send('fetchZoomLevels'); |
| 353 }, |
| 354 |
| 355 /** @override */ |
| 356 removeZoomLevel: function(host) { |
| 357 chrome.send('removeZoomLevel', [host]); |
| 358 }, |
329 }; | 359 }; |
330 | 360 |
331 return { | 361 return { |
332 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, | 362 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, |
333 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, | 363 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, |
334 }; | 364 }; |
335 }); | 365 }); |
OLD | NEW |