| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 getDefaultCaptureDevices: function(type) {}, | 110 getDefaultCaptureDevices: function(type) {}, |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Sets a default devices for a given type of media. | 113 * Sets a default devices for a given type of media. |
| 114 * @param {string} type The type of media to configure. | 114 * @param {string} type The type of media to configure. |
| 115 * @param {string} defaultValue The id of the media device to set. | 115 * @param {string} defaultValue The id of the media device to set. |
| 116 */ | 116 */ |
| 117 setDefaultCaptureDevice: function(type, defaultValue) {}, | 117 setDefaultCaptureDevice: function(type, defaultValue) {}, |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Reloads all cookies. List is returned through a JS call to loadChildren. | 120 * Reloads all cookies. |
| 121 * @return {!Promise<Array<CookieDataSummaryItem>>} Returns the full cookie |
| 122 * list. |
| 121 */ | 123 */ |
| 122 reloadCookies: function() {}, | 124 reloadCookies: function() {}, |
| 123 | 125 |
| 124 /** | 126 /** |
| 125 * Fetches all children of a given cookie. List is returned through a JS | 127 * Fetches all children of a given cookie. |
| 126 * call to loadChildren. | |
| 127 * @param {string} path The path to the parent cookie. | 128 * @param {string} path The path to the parent cookie. |
| 129 * @return {!Promise<Array<CookieDataSummaryItem>>} Returns a cookie list |
| 130 * for the given path. |
| 128 */ | 131 */ |
| 129 loadCookieChildren: function(path) {}, | 132 loadCookieChildren: function(path) {}, |
| 130 | 133 |
| 131 /** | 134 /** |
| 132 * Removes a given cookie. | 135 * Removes a given cookie. |
| 133 * @param {string} path The path to the parent cookie. | 136 * @param {string} path The path to the parent cookie. |
| 134 */ | 137 */ |
| 135 removeCookie: function(path) {}, | 138 removeCookie: function(path) {}, |
| 136 | 139 |
| 137 /** | 140 /** |
| 141 * Removes all cookies. |
| 142 * @return {!Promise<Array<CookieDataSummaryItem>>} Returns the up to date |
| 143 * cookie list once deletion is complete (empty list). |
| 144 */ |
| 145 removeAllCookies: function() {}, |
| 146 |
| 147 /** |
| 138 * Initializes the protocol handler list. List is returned through JS calls | 148 * Initializes the protocol handler list. List is returned through JS calls |
| 139 * to setHandlersEnabled, setProtocolHandlers & setIgnoredProtocolHandlers. | 149 * to setHandlersEnabled, setProtocolHandlers & setIgnoredProtocolHandlers. |
| 140 */ | 150 */ |
| 141 initializeProtocolHandlerList: function() {}, | 151 initializeProtocolHandlerList: function() {}, |
| 142 | 152 |
| 143 /** | 153 /** |
| 144 * Enables or disables the ability for sites to ask to become the default | 154 * Enables or disables the ability for sites to ask to become the default |
| 145 * protocol handlers. | 155 * protocol handlers. |
| 146 * @param {boolean} enabled Whether sites can ask to become default. | 156 * @param {boolean} enabled Whether sites can ask to become default. |
| 147 */ | 157 */ |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 chrome.send('getDefaultCaptureDevices', [type]); | 222 chrome.send('getDefaultCaptureDevices', [type]); |
| 213 }, | 223 }, |
| 214 | 224 |
| 215 /** @override */ | 225 /** @override */ |
| 216 setDefaultCaptureDevice: function(type, defaultValue) { | 226 setDefaultCaptureDevice: function(type, defaultValue) { |
| 217 chrome.send('setDefaultCaptureDevice', [type, defaultValue]); | 227 chrome.send('setDefaultCaptureDevice', [type, defaultValue]); |
| 218 }, | 228 }, |
| 219 | 229 |
| 220 /** @override */ | 230 /** @override */ |
| 221 reloadCookies: function() { | 231 reloadCookies: function() { |
| 222 chrome.send('reloadCookies'); | 232 return cr.sendWithPromise('reloadCookies'); |
| 223 }, | 233 }, |
| 224 | 234 |
| 225 /** @override */ | 235 /** @override */ |
| 226 loadCookieChildren: function(path) { | 236 loadCookieChildren: function(path) { |
| 227 chrome.send('loadCookie', [path]); | 237 return cr.sendWithPromise('loadCookie', path); |
| 228 }, | 238 }, |
| 229 | 239 |
| 230 /** @override */ | 240 /** @override */ |
| 231 removeCookie: function(path) { | 241 removeCookie: function(path) { |
| 232 chrome.send('removeCookie', [path]); | 242 chrome.send('removeCookie', [path]); |
| 233 }, | 243 }, |
| 234 | 244 |
| 245 /** @override */ |
| 246 removeAllCookies: function() { |
| 247 return cr.sendWithPromise('removeAllCookies'); |
| 248 }, |
| 249 |
| 250 |
| 235 initializeProtocolHandlerList: function() { | 251 initializeProtocolHandlerList: function() { |
| 236 chrome.send('initializeProtocolHandlerList'); | 252 chrome.send('initializeProtocolHandlerList'); |
| 237 }, | 253 }, |
| 238 | 254 |
| 239 /** @override */ | 255 /** @override */ |
| 240 setProtocolHandlerDefault: function(enabled) { | 256 setProtocolHandlerDefault: function(enabled) { |
| 241 chrome.send('setHandlersEnabled', [enabled]); | 257 chrome.send('setHandlersEnabled', [enabled]); |
| 242 }, | 258 }, |
| 243 | 259 |
| 244 /** @override */ | 260 /** @override */ |
| 245 setProtocolDefault: function(protocol, url) { | 261 setProtocolDefault: function(protocol, url) { |
| 246 chrome.send('setDefault', [[protocol, url]]); | 262 chrome.send('setDefault', [[protocol, url]]); |
| 247 }, | 263 }, |
| 248 | 264 |
| 249 /** @override */ | 265 /** @override */ |
| 250 removeProtocolHandler: function(protocol, url) { | 266 removeProtocolHandler: function(protocol, url) { |
| 251 chrome.send('removeHandler', [[protocol, url]]); | 267 chrome.send('removeHandler', [[protocol, url]]); |
| 252 }, | 268 }, |
| 253 }; | 269 }; |
| 254 | 270 |
| 255 return { | 271 return { |
| 256 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, | 272 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, |
| 257 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, | 273 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, |
| 258 }; | 274 }; |
| 259 }); | 275 }); |
| OLD | NEW |