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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 var args = [listItem.contentType]; | 582 var args = [listItem.contentType]; |
583 if (listItem.contentType == 'notifications') | 583 if (listItem.contentType == 'notifications') |
584 args.push(dataItem.origin, dataItem.setting); | 584 args.push(dataItem.origin, dataItem.setting); |
585 else | 585 else |
586 args.push(listItem.mode, dataItem.origin, dataItem.embeddingOrigin); | 586 args.push(listItem.mode, dataItem.origin, dataItem.embeddingOrigin); |
587 | 587 |
588 chrome.send('removeException', args); | 588 chrome.send('removeException', args); |
589 }, | 589 }, |
590 }; | 590 }; |
591 | 591 |
592 var OptionsPage = options.OptionsPage; | 592 var Page = cr.ui.pageManager.Page; |
| 593 var PageManager = cr.ui.pageManager.PageManager; |
593 | 594 |
594 /** | 595 /** |
595 * Encapsulated handling of content settings list subpage. | 596 * Encapsulated handling of content settings list subpage. |
596 * | 597 * |
597 * @constructor | 598 * @constructor |
598 */ | 599 */ |
599 function ContentSettingsExceptionsArea() { | 600 function ContentSettingsExceptionsArea() { |
600 OptionsPage.call(this, 'contentExceptions', | 601 Page.call(this, 'contentExceptions', |
601 loadTimeData.getString('contentSettingsPageTabTitle'), | 602 loadTimeData.getString('contentSettingsPageTabTitle'), |
602 'content-settings-exceptions-area'); | 603 'content-settings-exceptions-area'); |
603 } | 604 } |
604 | 605 |
605 cr.addSingletonGetter(ContentSettingsExceptionsArea); | 606 cr.addSingletonGetter(ContentSettingsExceptionsArea); |
606 | 607 |
607 ContentSettingsExceptionsArea.prototype = { | 608 ContentSettingsExceptionsArea.prototype = { |
608 __proto__: OptionsPage.prototype, | 609 __proto__: Page.prototype, |
609 | 610 |
610 /** @override */ | 611 /** @override */ |
611 initializePage: function() { | 612 initializePage: function() { |
612 OptionsPage.prototype.initializePage.call(this); | 613 Page.prototype.initializePage.call(this); |
613 | 614 |
614 var exceptionsLists = this.pageDiv.querySelectorAll('list'); | 615 var exceptionsLists = this.pageDiv.querySelectorAll('list'); |
615 for (var i = 0; i < exceptionsLists.length; i++) { | 616 for (var i = 0; i < exceptionsLists.length; i++) { |
616 options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]); | 617 options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]); |
617 } | 618 } |
618 | 619 |
619 ContentSettingsExceptionsArea.hideOTRLists(false); | 620 ContentSettingsExceptionsArea.hideOTRLists(false); |
620 | 621 |
621 // If the user types in the URL without a hash, show just cookies. | 622 // If the user types in the URL without a hash, show just cookies. |
622 this.showList('cookies'); | 623 this.showList('cookies'); |
623 | 624 |
624 $('content-settings-exceptions-overlay-confirm').onclick = | 625 $('content-settings-exceptions-overlay-confirm').onclick = |
625 OptionsPage.closeOverlay.bind(OptionsPage); | 626 PageManager.closeOverlay.bind(PageManager); |
626 }, | 627 }, |
627 | 628 |
628 /** | 629 /** |
629 * Shows one list and hides all others. | 630 * Shows one list and hides all others. |
630 * | 631 * |
631 * @param {string} type The content type. | 632 * @param {string} type The content type. |
632 */ | 633 */ |
633 showList: function(type) { | 634 showList: function(type) { |
634 // Update the title for the type that was shown. | 635 // Update the title for the type that was shown. |
635 this.title = loadTimeData.getString(type + 'TabTitle'); | 636 this.title = loadTimeData.getString(type + 'TabTitle'); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 } | 685 } |
685 }; | 686 }; |
686 | 687 |
687 return { | 688 return { |
688 ExceptionsListItem: ExceptionsListItem, | 689 ExceptionsListItem: ExceptionsListItem, |
689 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 690 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
690 ExceptionsList: ExceptionsList, | 691 ExceptionsList: ExceptionsList, |
691 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 692 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
692 }; | 693 }; |
693 }); | 694 }); |
OLD | NEW |