| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview A helper object used from the "Site Settings" section to |
| 7 * interact with the content settings prefs. |
| 8 */ |
| 9 |
| 10 cr.define('settings', function() { |
| 11 /** @constructor */ |
| 12 function SiteSettingsPrefsBrowserProxy() {}; |
| 13 |
| 14 // The singleton instance_ is replaced with a test version of this wrapper |
| 15 // during testing. |
| 16 cr.addSingletonGetter(SiteSettingsPrefsBrowserProxy); |
| 17 |
| 18 SiteSettingsPrefsBrowserProxy.prototype = { |
| 19 /** |
| 20 * Sets the default value for a site settings category. |
| 21 * @param {number} contentType The category to change. |
| 22 * @param {number} defaultValue The value to set as default. |
| 23 */ |
| 24 setDefaultValueForContentType: function(contentType, defaultValue) { |
| 25 chrome.send('setDefaultValueForContentType', [contentType, defaultValue]); |
| 26 }, |
| 27 |
| 28 /** |
| 29 * Gets the default value for a site settings category. |
| 30 * @param {number} contentType The category to change. |
| 31 * @return {Promise} |
| 32 */ |
| 33 getDefaultValueForContentType: function(contentType) { |
| 34 return cr.sendWithPromise('getDefaultValueForContentType', contentType); |
| 35 }, |
| 36 }; |
| 37 |
| 38 return { |
| 39 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, |
| 40 }; |
| 41 }); |
| OLD | NEW |