Chromium Code Reviews| Index: chrome/browser/resources/supervised_user_internals.js |
| diff --git a/chrome/browser/resources/supervised_user_internals.js b/chrome/browser/resources/supervised_user_internals.js |
| index 065639ec1804e0128f17a3d347ef39156ef30e2b..608ae38720785e92f6a5ef9e2c89f2ba72e762f0 100644 |
| --- a/chrome/browser/resources/supervised_user_internals.js |
| +++ b/chrome/browser/resources/supervised_user_internals.js |
| @@ -39,7 +39,7 @@ cr.define('chrome.supervised_user_internals', function() { |
| } |
| function receiveBasicInfo(info) { |
| - jstProcess(new JsEvalContext(info), $('info')); |
| + jstProcess(new JsEvalContext(info), $('basic-info')); |
| // Hack: Schedule another refresh after a while. |
| // TODO(treib): Get rid of this once we're properly notified of all |
| @@ -47,6 +47,24 @@ cr.define('chrome.supervised_user_internals', function() { |
| setTimeout(function() { chrome.send('getBasicInfo'); }, 5000); |
| } |
| + function receiveUserSettings(settings) { |
| + // The user settings are returned as an object, flatten them into a |
| + // list of key/value pairs for easier consumption by the HTML template. |
| + // This is not done recursively, values are passed as their JSON |
| + // representation. |
| + var keys = Object.keys(settings); |
| + var kvpairs = []; |
| + |
| + for (var i = 0; i < keys.length; i++) { |
| + kvpairs.push({ |
|
Bernhard Bauer
2015/08/18 13:09:09
You could do this with Object.keys(settings).map(f
PEConn2
2015/08/18 14:02:58
Done.
|
| + key: keys[i], |
| + value: JSON.stringify(settings[keys[i]], null, 2) |
| + }); |
| + } |
| + |
| + jstProcess(new JsEvalContext({settings: kvpairs}), $('user-settings')); |
| + } |
| + |
| function receiveTryURLResult(result) { |
| $('try-url-result').textContent = result; |
| } |
| @@ -95,6 +113,7 @@ cr.define('chrome.supervised_user_internals', function() { |
| initialize: initialize, |
| highlightIfChanged: highlightIfChanged, |
| receiveBasicInfo: receiveBasicInfo, |
| + receiveUserSettings: receiveUserSettings, |
| receiveTryURLResult: receiveTryURLResult, |
| receiveFilteringResult: receiveFilteringResult, |
| }; |