Chromium Code Reviews| 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 SiteSettingsPrefsProxy() {}; | |
|
tommycli
2016/02/18 22:15:19
SiteSettingsPrefsBrowserProxy. I think the pattern
Finnur
2016/02/19 10:18:13
Done.
| |
| 13 | |
| 14 // TODOf figure out test. | |
|
tommycli
2016/02/18 22:15:18
nit: typo?
Finnur
2016/02/19 10:18:13
No, these are private messages for me. In this cas
| |
| 15 // The singleton instance_ is replaced with a test version of this wrapper | |
| 16 // during testing. | |
| 17 cr.addSingletonGetter(SiteSettingsPrefsProxy); | |
| 18 | |
| 19 SiteSettingsPrefsProxy.prototype = { | |
| 20 /** | |
| 21 * Sets the default value for a site settings category. | |
| 22 * @param {number} contentType The category to change. | |
| 23 * @param {number} defaultValue The value to set as default. | |
| 24 */ | |
| 25 setDefaultValueForContentType: function(contentType, defaultValue) { | |
| 26 chrome.send('setDefaultValueForContentType', [contentType, defaultValue]); | |
| 27 }, | |
| 28 | |
| 29 /** | |
| 30 * Gets the default value for a site settings category. | |
| 31 * @param {number} contentType The category to change. | |
| 32 * @return {Promise} | |
| 33 */ | |
| 34 getDefaultValueForContentType: function(contentType) { | |
| 35 return cr.sendWithPromise('getDefaultValueForContentType', contentType); | |
| 36 }, | |
| 37 }; | |
| 38 | |
| 39 return { | |
| 40 SiteSettingsPrefsProxy: SiteSettingsPrefsProxy, | |
| 41 }; | |
| 42 }); | |
| OLD | NEW |