OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 DeletableItemList = options.DeletableItemList; | 6 const DeletableItemList = options.DeletableItemList; |
7 const DeletableItem = options.DeletableItem; | 7 const DeletableItem = options.DeletableItem; |
8 const ArrayDataModel = cr.ui.ArrayDataModel; | 8 const ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
11 * Creates a new exceptions list item. | 11 * Creates a new exceptions list item. |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 // The null creates the Add New Exception row. | 506 // The null creates the Add New Exception row. |
507 this.dataModel = new ArrayDataModel([null]); | 507 this.dataModel = new ArrayDataModel([null]); |
508 } else { | 508 } else { |
509 this.dataModel = new ArrayDataModel([]); | 509 this.dataModel = new ArrayDataModel([]); |
510 } | 510 } |
511 }, | 511 }, |
512 | 512 |
513 /** @inheritDoc */ | 513 /** @inheritDoc */ |
514 deleteItemAtIndex: function(index) { | 514 deleteItemAtIndex: function(index) { |
515 var listItem = this.getListItemByIndex(index); | 515 var listItem = this.getListItemByIndex(index); |
516 if (listItem.undeletable) { | 516 if (listItem.undeletable) |
517 console.log('Tried to delete an undeletable row.'); | |
518 return; | 517 return; |
519 } | |
520 | 518 |
521 var dataItem = listItem.dataItem; | 519 var dataItem = listItem.dataItem; |
522 var args = [listItem.contentType]; | 520 var args = [listItem.contentType]; |
523 if (listItem.contentType == 'location') | 521 if (listItem.contentType == 'location') |
524 args.push(dataItem['origin'], dataItem['embeddingOrigin']); | 522 args.push(dataItem['origin'], dataItem['embeddingOrigin']); |
525 else if (listItem.contentType == 'notifications') | 523 else if (listItem.contentType == 'notifications') |
526 args.push(dataItem['origin'], dataItem['setting']); | 524 args.push(dataItem['origin'], dataItem['setting']); |
527 else | 525 else |
528 args.push(listItem.mode, listItem.pattern); | 526 args.push(listItem.mode, listItem.pattern); |
529 | 527 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 } | 602 } |
605 }; | 603 }; |
606 | 604 |
607 return { | 605 return { |
608 ExceptionsListItem: ExceptionsListItem, | 606 ExceptionsListItem: ExceptionsListItem, |
609 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 607 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
610 ExceptionsList: ExceptionsList, | 608 ExceptionsList: ExceptionsList, |
611 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 609 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
612 }; | 610 }; |
613 }); | 611 }); |
OLD | NEW |