Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3705)

Unified Diff: chrome/browser/resources/supervised_user_internals.js

Issue 1300643002: Added user settings to chrome://supervised-user-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,
};

Powered by Google App Engine
This is Rietveld 408576698