Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/site_settings_prefs_proxy.js |
| diff --git a/chrome/browser/resources/settings/site_settings/site_settings_prefs_proxy.js b/chrome/browser/resources/settings/site_settings/site_settings_prefs_proxy.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1970cae4516580e7c7ae9d390fe5a285fb039f90 |
| --- /dev/null |
| +++ b/chrome/browser/resources/settings/site_settings/site_settings_prefs_proxy.js |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * @fileoverview A helper object used from the "Site Settings" section to |
| + * interact with the content settings prefs. |
| + */ |
| + |
| +cr.define('settings', function() { |
| + /** @constructor */ |
| + function SiteSettingsPrefsProxy() {}; |
|
tommycli
2016/02/18 22:15:19
SiteSettingsPrefsBrowserProxy. I think the pattern
Finnur
2016/02/19 10:18:13
Done.
|
| + |
| + // 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
|
| + // The singleton instance_ is replaced with a test version of this wrapper |
| + // during testing. |
| + cr.addSingletonGetter(SiteSettingsPrefsProxy); |
| + |
| + SiteSettingsPrefsProxy.prototype = { |
| + /** |
| + * Sets the default value for a site settings category. |
| + * @param {number} contentType The category to change. |
| + * @param {number} defaultValue The value to set as default. |
| + */ |
| + setDefaultValueForContentType: function(contentType, defaultValue) { |
| + chrome.send('setDefaultValueForContentType', [contentType, defaultValue]); |
| + }, |
| + |
| + /** |
| + * Gets the default value for a site settings category. |
| + * @param {number} contentType The category to change. |
| + * @return {Promise} |
| + */ |
| + getDefaultValueForContentType: function(contentType) { |
| + return cr.sendWithPromise('getDefaultValueForContentType', contentType); |
| + }, |
| + }; |
| + |
| + return { |
| + SiteSettingsPrefsProxy: SiteSettingsPrefsProxy, |
| + }; |
| +}); |