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 initializePage: function() { | 611 initializePage: function() { |
611 OptionsPage.prototype.initializePage.call(this); | 612 Page.prototype.initializePage.call(this); |
612 | 613 |
613 var exceptionsLists = this.pageDiv.querySelectorAll('list'); | 614 var exceptionsLists = this.pageDiv.querySelectorAll('list'); |
614 for (var i = 0; i < exceptionsLists.length; i++) { | 615 for (var i = 0; i < exceptionsLists.length; i++) { |
615 options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]); | 616 options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]); |
616 } | 617 } |
617 | 618 |
618 ContentSettingsExceptionsArea.hideOTRLists(false); | 619 ContentSettingsExceptionsArea.hideOTRLists(false); |
619 | 620 |
620 // If the user types in the URL without a hash, show just cookies. | 621 // If the user types in the URL without a hash, show just cookies. |
621 this.showList('cookies'); | 622 this.showList('cookies'); |
622 | 623 |
623 $('content-settings-exceptions-overlay-confirm').onclick = | 624 $('content-settings-exceptions-overlay-confirm').onclick = |
624 OptionsPage.closeOverlay.bind(OptionsPage); | 625 PageManager.closeOverlay.bind(PageManager); |
625 }, | 626 }, |
626 | 627 |
627 /** | 628 /** |
628 * Shows one list and hides all others. | 629 * Shows one list and hides all others. |
629 * | 630 * |
630 * @param {string} type The content type. | 631 * @param {string} type The content type. |
631 */ | 632 */ |
632 showList: function(type) { | 633 showList: function(type) { |
633 // Update the title for the type that was shown. | 634 // Update the title for the type that was shown. |
634 this.title = loadTimeData.getString(type + 'TabTitle'); | 635 this.title = loadTimeData.getString(type + 'TabTitle'); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 684 } |
684 }; | 685 }; |
685 | 686 |
686 return { | 687 return { |
687 ExceptionsListItem: ExceptionsListItem, | 688 ExceptionsListItem: ExceptionsListItem, |
688 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 689 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
689 ExceptionsList: ExceptionsList, | 690 ExceptionsList: ExceptionsList, |
690 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 691 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
691 }; | 692 }; |
692 }); | 693 }); |
OLD | NEW |