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 16 matching lines...) Expand all Loading... |
27 * notifications: Array<SiteException>}} | 27 * notifications: Array<SiteException>}} |
28 */ | 28 */ |
29 var ExceptionListPref; | 29 var ExceptionListPref; |
30 | 30 |
31 /** | 31 /** |
32 * @typedef {{defaults: CategoryDefaultsPref, | 32 * @typedef {{defaults: CategoryDefaultsPref, |
33 * exceptions: ExceptionListPref}} | 33 * exceptions: ExceptionListPref}} |
34 */ | 34 */ |
35 var SiteSettingsPref; | 35 var SiteSettingsPref; |
36 | 36 |
| 37 /** |
| 38 * @typedef {{name: string, |
| 39 * id: string}} |
| 40 */ |
| 41 var MediaPickerEntry; |
| 42 |
37 cr.define('settings', function() { | 43 cr.define('settings', function() { |
38 /** @interface */ | 44 /** @interface */ |
39 function SiteSettingsPrefsBrowserProxy() {} | 45 function SiteSettingsPrefsBrowserProxy() {} |
40 | 46 |
41 SiteSettingsPrefsBrowserProxy.prototype = { | 47 SiteSettingsPrefsBrowserProxy.prototype = { |
42 /** | 48 /** |
43 * Sets the default value for a site settings category. | 49 * Sets the default value for a site settings category. |
44 * @param {number} contentType The category to change. | 50 * @param {number} contentType The category to change. |
45 * @param {number} defaultValue The value to set as default. | 51 * @param {number} defaultValue The value to set as default. |
46 */ | 52 */ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 */ | 88 */ |
83 setCategoryPermissionForOrigin: function( | 89 setCategoryPermissionForOrigin: function( |
84 primaryPattern, secondaryPattern, contentType, value) {}, | 90 primaryPattern, secondaryPattern, contentType, value) {}, |
85 | 91 |
86 /** | 92 /** |
87 * Checks whether a pattern is valid. | 93 * Checks whether a pattern is valid. |
88 * @param {string} pattern The pattern to check | 94 * @param {string} pattern The pattern to check |
89 * @return {!Promise<boolean>} True if the pattern is valid. | 95 * @return {!Promise<boolean>} True if the pattern is valid. |
90 */ | 96 */ |
91 isPatternValid: function(pattern) {}, | 97 isPatternValid: function(pattern) {}, |
| 98 |
| 99 /** |
| 100 * Gets the list of default capture devices for a given type of media. List |
| 101 * is returned through a JS call to updateDevicesMenu. |
| 102 * @param {string} type The type to look up. |
| 103 */ |
| 104 getDefaultCaptureDevices: function(type) {}, |
| 105 |
| 106 /** |
| 107 * Sets a default devices for a given type of media. |
| 108 * @param {string} type The type of media to configure. |
| 109 * @param {string} defaultValue The id of the media device to set. |
| 110 */ |
| 111 setDefaultCaptureDevice: function(type, defaultValue) {}, |
92 }; | 112 }; |
93 | 113 |
94 /** | 114 /** |
95 * @constructor | 115 * @constructor |
96 * @implements {SiteSettingsPrefsBrowserProxy} | 116 * @implements {SiteSettingsPrefsBrowserProxy} |
97 */ | 117 */ |
98 function SiteSettingsPrefsBrowserProxyImpl() {} | 118 function SiteSettingsPrefsBrowserProxyImpl() {} |
99 | 119 |
100 // The singleton instance_ is replaced with a test version of this wrapper | 120 // The singleton instance_ is replaced with a test version of this wrapper |
101 // during testing. | 121 // during testing. |
(...skipping 27 matching lines...) Expand all Loading... |
129 primaryPattern, secondaryPattern, contentType, value) { | 149 primaryPattern, secondaryPattern, contentType, value) { |
130 chrome.send('setCategoryPermissionForOrigin', | 150 chrome.send('setCategoryPermissionForOrigin', |
131 [primaryPattern, secondaryPattern, contentType, value]); | 151 [primaryPattern, secondaryPattern, contentType, value]); |
132 }, | 152 }, |
133 | 153 |
134 /** @override */ | 154 /** @override */ |
135 isPatternValid: function(pattern) { | 155 isPatternValid: function(pattern) { |
136 return cr.sendWithPromise('isPatternValid', pattern); | 156 return cr.sendWithPromise('isPatternValid', pattern); |
137 }, | 157 }, |
138 | 158 |
| 159 /** @override */ |
| 160 getDefaultCaptureDevices: function(type) { |
| 161 chrome.send('getDefaultCaptureDevices', [type]); |
| 162 }, |
| 163 |
| 164 /** @override */ |
| 165 setDefaultCaptureDevice: function(type, defaultValue) { |
| 166 chrome.send('setDefaultCaptureDevice', [type, defaultValue]); |
| 167 }, |
139 }; | 168 }; |
140 | 169 |
141 return { | 170 return { |
142 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, | 171 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, |
143 }; | 172 }; |
144 }); | 173 }); |
OLD | NEW |