Index: chrome/browser/resources/options/search_engine_manager_engine_list.js |
diff --git a/chrome/browser/resources/options/search_engine_manager_engine_list.js b/chrome/browser/resources/options/search_engine_manager_engine_list.js |
index ae9e5a8a669a6e6ad916eb3f8b4fb0c0cf188d33..fb0045b395d22b0f2597a9e033623719a671f1fd 100644 |
--- a/chrome/browser/resources/options/search_engine_manager_engine_list.js |
+++ b/chrome/browser/resources/options/search_engine_manager_engine_list.js |
@@ -3,6 +3,8 @@ |
// found in the LICENSE file. |
cr.define('options.search_engines', function() { |
+ /** @const */ var ControlledSettingIndicator = |
+ options.ControlledSettingIndicator; |
/** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
/** @const */ var InlineEditableItem = options.InlineEditableItem; |
/** @const */ var ListSelectionController = cr.ui.ListSelectionController; |
@@ -137,6 +139,18 @@ cr.define('options.search_engines', function() { |
urlWithButtonEl.appendChild(makeDefaultButtonEl); |
} |
+ if (engine.controlledBy == 'policy') { |
+ this.querySelector('.row-delete-button').hidden = true; |
+ var indicator = ControlledSettingIndicator(); |
+ indicator.setAttribute('setting', 'search-engine'); |
+ // Create a synthetic pref change event decorated as |
+ // CoreOptionsHandler::CreateValueForPref() does. |
+ var event = new cr.Event(this.contentType); |
+ event.value = { controlledBy: engine.controlledBy }; |
+ indicator.handlePrefChange(event); |
+ this.appendChild(indicator); |
+ } |
+ |
// Do final adjustment to the input fields. |
this.nameField_ = nameEl.querySelector('input'); |
// The editable field uses the raw name, not the display name. |