Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js

Issue 2598893002: [MD settings] lighter weight initializer for protocol handler enabled messages (Closed)
Patch Set: review changes Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 removeCookie: function(path) {}, 201 removeCookie: function(path) {},
202 202
203 /** 203 /**
204 * Removes all cookies. 204 * Removes all cookies.
205 * @return {!Promise<!CookieList>} Returns the up to date 205 * @return {!Promise<!CookieList>} Returns the up to date
206 * cookie list once deletion is complete (empty list). 206 * cookie list once deletion is complete (empty list).
207 */ 207 */
208 removeAllCookies: function() {}, 208 removeAllCookies: function() {},
209 209
210 /** 210 /**
211 * Initializes the protocol handler list. List is returned through JS calls 211 * observes _all_ of the the protocol handler state, which includes a list
212 * to setHandlersEnabled, setProtocolHandlers & setIgnoredProtocolHandlers. 212 * that is returned through JS calls to 'setProtocolHandlers' along with
213 * other state sent with the messages 'setIgnoredProtocolHandler' and
214 * 'setHandlersEnabled'.
213 */ 215 */
214 initializeProtocolHandlerList: function() {}, 216 observeProtocolHandlers: function() {},
217
218 /**
219 * Observes one aspect of the protocol handler so that updates to the
220 * enabled/disabled state are sent. A 'setHandlersEnabled' will be sent
221 * from C++ immediately after receiving this observe request and updates
222 * may follow via additional 'setHandlersEnabled' messages.
223 *
224 * If |observeProtocolHandlers| is called, there's no need to call this
225 * observe as well.
226 */
227 observeProtocolHandlersEnabledState: function() {},
215 228
216 /** 229 /**
217 * Enables or disables the ability for sites to ask to become the default 230 * Enables or disables the ability for sites to ask to become the default
218 * protocol handlers. 231 * protocol handlers.
219 * @param {boolean} enabled Whether sites can ask to become default. 232 * @param {boolean} enabled Whether sites can ask to become default.
220 */ 233 */
221 setProtocolHandlerDefault: function(enabled) {}, 234 setProtocolHandlerDefault: function(enabled) {},
222 235
223 /** 236 /**
224 * Sets a certain url as default for a given protocol handler. 237 * Sets a certain url as default for a given protocol handler.
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 /** @override */ 360 /** @override */
348 removeCookie: function(path) { 361 removeCookie: function(path) {
349 chrome.send('removeCookie', [path]); 362 chrome.send('removeCookie', [path]);
350 }, 363 },
351 364
352 /** @override */ 365 /** @override */
353 removeAllCookies: function() { 366 removeAllCookies: function() {
354 return cr.sendWithPromise('removeAllCookies'); 367 return cr.sendWithPromise('removeAllCookies');
355 }, 368 },
356 369
357 initializeProtocolHandlerList: function() { 370 /** @override */
358 chrome.send('initializeProtocolHandlerList'); 371 observeProtocolHandlers: function() {
372 chrome.send('observeProtocolHandlers');
359 }, 373 },
360 374
361 /** @override */ 375 /** @override */
376 observeProtocolHandlersEnabledState: function() {
377 chrome.send('observeProtocolHandlersEnabledState');
378 },
379
380 /** @override */
362 setProtocolHandlerDefault: function(enabled) { 381 setProtocolHandlerDefault: function(enabled) {
363 chrome.send('setHandlersEnabled', [enabled]); 382 chrome.send('setHandlersEnabled', [enabled]);
364 }, 383 },
365 384
366 /** @override */ 385 /** @override */
367 setProtocolDefault: function(protocol, url) { 386 setProtocolDefault: function(protocol, url) {
368 chrome.send('setDefault', [[protocol, url]]); 387 chrome.send('setDefault', [[protocol, url]]);
369 }, 388 },
370 389
371 /** @override */ 390 /** @override */
(...skipping 25 matching lines...) Expand all
397 removeZoomLevel: function(host) { 416 removeZoomLevel: function(host) {
398 chrome.send('removeZoomLevel', [host]); 417 chrome.send('removeZoomLevel', [host]);
399 }, 418 },
400 }; 419 };
401 420
402 return { 421 return {
403 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, 422 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy,
404 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, 423 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl,
405 }; 424 };
406 }); 425 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698