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 var Preferences = options.Preferences; | 6 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 text = this.getAttribute('text' + this.controlledBy); | 138 text = this.getAttribute('text' + this.controlledBy); |
139 | 139 |
140 // Create the DOM tree. | 140 // Create the DOM tree. |
141 var content = document.createElement('div'); | 141 var content = document.createElement('div'); |
142 content.classList.add('controlled-setting-bubble-header'); | 142 content.classList.add('controlled-setting-bubble-header'); |
143 content.textContent = text; | 143 content.textContent = text; |
144 | 144 |
145 if (this.controlledBy == 'hasRecommendation' && this.resetHandler_ && | 145 if (this.controlledBy == 'hasRecommendation' && this.resetHandler_ && |
146 !this.readOnly) { | 146 !this.readOnly) { |
147 var container = document.createElement('div'); | 147 var container = document.createElement('div'); |
148 var action = document.createElement('button'); | 148 var action = document.createElement('a', 'action-link'); |
149 action.classList.add('link-button'); | |
150 action.classList.add('controlled-setting-bubble-action'); | 149 action.classList.add('controlled-setting-bubble-action'); |
151 action.textContent = | 150 action.textContent = |
152 loadTimeData.getString('controlledSettingFollowRecommendation'); | 151 loadTimeData.getString('controlledSettingFollowRecommendation'); |
153 action.addEventListener('click', function(event) { | 152 action.addEventListener('click', function(event) { |
154 self.resetHandler_(); | 153 self.resetHandler_(); |
155 }); | 154 }); |
156 container.appendChild(action); | 155 container.appendChild(action); |
157 content.appendChild(container); | 156 content.appendChild(container); |
158 } else if (this.controlledBy == 'extension' && this.extensionName) { | 157 } else if (this.controlledBy == 'extension' && this.extensionName) { |
159 var extensionContainer = | 158 var extensionContainer = |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 * - unset: The value is controlled by the user alone. | 231 * - unset: The value is controlled by the user alone. |
233 */ | 232 */ |
234 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', | 233 cr.defineProperty(ControlledSettingIndicator, 'controlledBy', |
235 cr.PropertyKind.ATTR); | 234 cr.PropertyKind.ATTR); |
236 | 235 |
237 // Export. | 236 // Export. |
238 return { | 237 return { |
239 ControlledSettingIndicator: ControlledSettingIndicator | 238 ControlledSettingIndicator: ControlledSettingIndicator |
240 }; | 239 }; |
241 }); | 240 }); |
OLD | NEW |