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.contentSettings', function() { | 5 cr.define('options.contentSettings', function() { |
6 /** @const */ var ControlledSettingIndicator = | 6 /** @const */ var ControlledSettingIndicator = |
7 options.ControlledSettingIndicator; | 7 options.ControlledSettingIndicator; |
8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; | 8 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
9 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 9 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
10 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 10 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 var event = new Event(this.contentType); | 182 var event = new Event(this.contentType); |
183 event.value = { controlledBy: controlledBy }; | 183 event.value = { controlledBy: controlledBy }; |
184 indicator.handlePrefChange(event); | 184 indicator.handlePrefChange(event); |
185 this.appendChild(indicator); | 185 this.appendChild(indicator); |
186 } | 186 } |
187 | 187 |
188 // If the exception comes from a hosted app, display the name and the | 188 // If the exception comes from a hosted app, display the name and the |
189 // icon of the app. | 189 // icon of the app. |
190 if (controlledBy == 'HostedApp') { | 190 if (controlledBy == 'HostedApp') { |
191 this.title = | 191 this.title = |
192 loadTimeData.getString('set_by') + ' ' + this.dataItem.appName; | 192 loadTimeData.getString('setBy') + ' ' + this.dataItem.appName; |
193 var button = this.querySelector('.row-delete-button'); | 193 var button = this.querySelector('.row-delete-button'); |
194 // Use the host app's favicon (16px, match bigger size). | 194 // Use the host app's favicon (16px, match bigger size). |
195 // See c/b/ui/webui/extensions/extension_icon_source.h | 195 // See c/b/ui/webui/extensions/extension_icon_source.h |
196 // for a description of the chrome://extension-icon URL. | 196 // for a description of the chrome://extension-icon URL. |
197 button.style.backgroundImage = | 197 button.style.backgroundImage = |
198 'url(\'chrome://extension-icon/' + this.dataItem.appId + '/16/1\')'; | 198 'url(\'chrome://extension-icon/' + this.dataItem.appId + '/16/1\')'; |
199 } | 199 } |
200 | 200 |
201 var listItem = this; | 201 var listItem = this; |
202 // Handle events on the editable nodes. | 202 // Handle events on the editable nodes. |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 /** | 614 /** |
615 * Shows one list and hides all others. | 615 * Shows one list and hides all others. |
616 * | 616 * |
617 * @param {string} type The content type. | 617 * @param {string} type The content type. |
618 */ | 618 */ |
619 showList: function(type) { | 619 showList: function(type) { |
620 // Update the title for the type that was shown. | 620 // Update the title for the type that was shown. |
621 this.title = loadTimeData.getString(type + 'TabTitle'); | 621 this.title = loadTimeData.getString(type + 'TabTitle'); |
622 | 622 |
623 var header = this.pageDiv.querySelector('h1'); | 623 var header = this.pageDiv.querySelector('h1'); |
624 header.textContent = loadTimeData.getString(type + '_header'); | 624 var camelCasedType = type.replace(/-([a-z])/g, function(g) { |
| 625 return g[1].toUpperCase(); |
| 626 }); |
| 627 header.textContent = loadTimeData.getString(camelCasedType + 'Header'); |
625 | 628 |
626 var divs = this.pageDiv.querySelectorAll('div[contentType]'); | 629 var divs = this.pageDiv.querySelectorAll('div[contentType]'); |
627 for (var i = 0; i < divs.length; i++) { | 630 for (var i = 0; i < divs.length; i++) { |
628 if (divs[i].getAttribute('contentType') == type) | 631 if (divs[i].getAttribute('contentType') == type) |
629 divs[i].hidden = false; | 632 divs[i].hidden = false; |
630 else | 633 else |
631 divs[i].hidden = true; | 634 divs[i].hidden = true; |
632 } | 635 } |
633 | 636 |
634 var mediaHeader = this.pageDiv.querySelector('.media-header'); | 637 var mediaHeader = this.pageDiv.querySelector('.media-header'); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 } | 672 } |
670 }; | 673 }; |
671 | 674 |
672 return { | 675 return { |
673 ExceptionsListItem: ExceptionsListItem, | 676 ExceptionsListItem: ExceptionsListItem, |
674 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 677 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
675 ExceptionsList: ExceptionsList, | 678 ExceptionsList: ExceptionsList, |
676 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 679 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
677 }; | 680 }; |
678 }); | 681 }); |
OLD | NEW |