| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var Preferences = options.Preferences; | 6 /** @const */ var Preferences = options.Preferences; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * A controlled setting indicator that can be placed on a setting as an | 9 * A controlled setting indicator that can be placed on a setting as an |
| 10 * indicator that the value is controlled by some external entity such as | 10 * indicator that the value is controlled by some external entity such as |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 content.classList.add('controlled-setting-bubble-header'); | 147 content.classList.add('controlled-setting-bubble-header'); |
| 148 content.textContent = text; | 148 content.textContent = text; |
| 149 | 149 |
| 150 if (this.controlledBy == 'hasRecommendation' && this.resetHandler_ && | 150 if (this.controlledBy == 'hasRecommendation' && this.resetHandler_ && |
| 151 !this.readOnly) { | 151 !this.readOnly) { |
| 152 var container = document.createElement('div'); | 152 var container = document.createElement('div'); |
| 153 var action = new ActionLink; | 153 var action = new ActionLink; |
| 154 action.classList.add('controlled-setting-bubble-action'); | 154 action.classList.add('controlled-setting-bubble-action'); |
| 155 action.textContent = | 155 action.textContent = |
| 156 loadTimeData.getString('controlledSettingFollowRecommendation'); | 156 loadTimeData.getString('controlledSettingFollowRecommendation'); |
| 157 action.addEventListener('click', | 157 action.addEventListener('click', this.resetHandler_.bind(this)); |
| 158 function(event) { self.resetHandler_(); }); | |
| 159 container.appendChild(action); | 158 container.appendChild(action); |
| 160 content.appendChild(container); | 159 content.appendChild(container); |
| 161 } else if (this.controlledBy == 'extension' && this.extensionName) { | 160 } else if (this.controlledBy == 'extension' && this.extensionName) { |
| 162 var extensionContainer = | 161 var extensionContainer = |
| 163 $('extension-controlled-settings-bubble-template').cloneNode(true); | 162 $('extension-controlled-settings-bubble-template').cloneNode(true); |
| 164 // No need for an id anymore, and thus remove to avoid id collision. | 163 // No need for an id anymore, and thus remove to avoid id collision. |
| 165 extensionContainer.removeAttribute('id'); | 164 extensionContainer.removeAttribute('id'); |
| 166 extensionContainer.hidden = false; | 165 extensionContainer.hidden = false; |
| 167 | 166 |
| 168 var extensionName = extensionContainer.querySelector( | 167 var extensionName = extensionContainer.querySelector( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 * ensuring that only one of them is visible at a time. | 213 * ensuring that only one of them is visible at a time. |
| 215 */ | 214 */ |
| 216 cr.defineProperty(ControlledSettingIndicator, 'value', | 215 cr.defineProperty(ControlledSettingIndicator, 'value', |
| 217 cr.PropertyKind.ATTR); | 216 cr.PropertyKind.ATTR); |
| 218 | 217 |
| 219 // Export. | 218 // Export. |
| 220 return { | 219 return { |
| 221 ControlledSettingIndicator: ControlledSettingIndicator | 220 ControlledSettingIndicator: ControlledSettingIndicator |
| 222 }; | 221 }; |
| 223 }); | 222 }); |
| OLD | NEW |