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

Unified Diff: chrome/browser/resources/options/handler_options_list.js

Issue 518673003: Add policy indicator for protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adds indicator for policy installed protocol handlers Created 6 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/options/handler_options_list.js
diff --git a/chrome/browser/resources/options/handler_options_list.js b/chrome/browser/resources/options/handler_options_list.js
index 12129a89a2558610258ed49cc2162e9e3abf4170..26f9f1f5842a7634a82f84f3f137cf1453b79c90 100644
--- a/chrome/browser/resources/options/handler_options_list.js
+++ b/chrome/browser/resources/options/handler_options_list.js
@@ -152,15 +152,22 @@ cr.define('options', function() {
this.appendChild(handlerElement);
// Remove link.
bartfab (slow) 2014/09/01 09:38:37 Nit: Move the comment inside the conditional. It a
- var removeElement = document.createElement('div');
- removeElement.textContent =
- loadTimeData.getString('handlers_remove_link');
- removeElement.addEventListener('click', function(e) {
- var value = selectElement ? selectElement.value : 0;
- delegate.removeHandler(value, data.handlers[value]);
- });
- removeElement.className = 'handlers-remove-column handlers-remove-link';
- this.appendChild(removeElement);
+ if (!data.policy_controlled) {
+ var removeElement = document.createElement('div');
+ removeElement.textContent =
+ loadTimeData.getString('handlers_remove_link');
+ removeElement.addEventListener('click', function(e) {
+ var value = selectElement ? selectElement.value : 0;
+ delegate.removeHandler(value, data.handlers[value]);
+ });
+ removeElement.className =
+ 'handlers-remove-column handlers-remove-link';
+ this.appendChild(removeElement);
+ } else if (data.default_handler != -1) {
+ var indicator = new options.ControlledSettingIndicator();
bartfab (slow) 2014/09/01 09:38:37 Nit: Add a comment that explains this is a policy
+ indicator.controlledBy = 'hasRecommendation';
+ this.appendChild(indicator);
+ }
},
/** @override */

Powered by Google App Engine
This is Rietveld 408576698