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

Unified Diff: chrome/browser/resources/chromeos/network_ui/network_ui.js

Issue 2620463003: Add getGlobalPolicy to networkingPrivate API. (Closed)
Patch Set: Add dcheck Created 3 years, 11 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/chromeos/network_ui/network_ui.js
diff --git a/chrome/browser/resources/chromeos/network_ui/network_ui.js b/chrome/browser/resources/chromeos/network_ui/network_ui.js
index 7b02ed8dd756530617816c1960ff33e675e67614..7b31697eacdf965501bc8f801c745716f8982248 100644
--- a/chrome/browser/resources/chromeos/network_ui/network_ui.js
+++ b/chrome/browser/resources/chromeos/network_ui/network_ui.js
@@ -314,6 +314,16 @@ var NetworkUI = (function() {
};
/**
+ * Requests the global policy dictionary and updates the page.
+ */
+ var requestGlobalPolicy = function() {
+ chrome.networkingPrivate.getGlobalPolicy(function(policy) {
+ document.querySelector('#global-policy').textContent =
Devlin 2017/01/10 15:25:21 Why document.querySelector('#foo') instead of $('f
stevenjb 2017/01/10 17:49:39 No particular reason, I just copied from somewhere
Devlin 2017/01/10 18:43:06 AFAIK, we still use $ liberally. It's also shorte
stevenjb 2017/01/10 18:58:29 I didn't mean to suggest that $ wasn't. We also ho
+ JSON.stringify(policy);
+ });
+ };
+
+ /**
* Sets refresh rate if the interval is found in the url.
*/
var setRefresh = function() {
@@ -334,6 +344,7 @@ var NetworkUI = (function() {
$('refresh').onclick = requestNetworks;
setRefresh();
requestNetworks();
+ requestGlobalPolicy();
});
document.addEventListener('custom-item-selected', function(event) {

Powered by Google App Engine
This is Rietveld 408576698