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 InlineEditableItemList = options.InlineEditableItemList; | 6 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
7 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 7 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 8 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // This one tracks the actual validity of the pattern in the input. This | 104 // This one tracks the actual validity of the pattern in the input. This |
105 // starts off as true so as not to annoy the user when he adds a new and | 105 // starts off as true so as not to annoy the user when he adds a new and |
106 // empty input. | 106 // empty input. |
107 this.inputIsValid = true; | 107 this.inputIsValid = true; |
108 | 108 |
109 this.input = input; | 109 this.input = input; |
110 this.select = select; | 110 this.select = select; |
111 | 111 |
112 this.updateEditables(); | 112 this.updateEditables(); |
113 | 113 |
114 // Editing notifications and geolocation is disabled for now. | 114 // Editing notifications, geolocation and mediastream is disabled for now. |
115 if (this.contentType == 'notifications' || | 115 if (this.contentType == 'notifications' || |
116 this.contentType == 'location') { | 116 this.contentType == 'location' || |
117 this.contentType == 'mediastream') { | |
Evan Stade
2012/06/15 18:51:25
why isn't fullscreen in this list?
no longer working on chromium
2012/06/15 21:04:47
Not sure, shall we add it?
Evan Stade
2012/06/15 21:33:32
could you find whoever added it to the list down b
no longer working on chromium
2012/06/18 10:22:49
I will ping the guy.
| |
117 this.editable = false; | 118 this.editable = false; |
118 } | 119 } |
119 | 120 |
120 // If the source of the content setting exception is not the user | 121 // If the source of the content setting exception is not the user |
121 // preference, then the content settings exception is managed and the user | 122 // preference, then the content settings exception is managed and the user |
122 // can't edit it. | 123 // can't edit it. |
123 if (this.dataItem.source && | 124 if (this.dataItem.source && |
124 this.dataItem.source != 'preference') { | 125 this.dataItem.source != 'preference') { |
125 this.setAttribute('managedby', this.dataItem.source); | 126 this.setAttribute('managedby', this.dataItem.source); |
126 this.deletable = false; | 127 this.deletable = false; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 // changed since we sent the request to analyze it). | 436 // changed since we sent the request to analyze it). |
436 if (pattern == listItem.input.value) | 437 if (pattern == listItem.input.value) |
437 listItem.setPatternValid(valid); | 438 listItem.setPatternValid(valid); |
438 } | 439 } |
439 }, | 440 }, |
440 | 441 |
441 /** | 442 /** |
442 * Returns whether the rows are editable in this list. | 443 * Returns whether the rows are editable in this list. |
443 */ | 444 */ |
444 isEditable: function() { | 445 isEditable: function() { |
445 // Editing notifications and geolocation is disabled for now. | 446 // Exceptions of the following lists are not editable for now. |
446 return !(this.contentType == 'notifications' || | 447 return !(this.contentType == 'notifications' || |
447 this.contentType == 'location' || | 448 this.contentType == 'location' || |
448 this.contentType == 'fullscreen'); | 449 this.contentType == 'fullscreen' || |
450 this.contentType == 'mediastream'); | |
449 }, | 451 }, |
450 | 452 |
451 /** | 453 /** |
452 * Removes all exceptions from the js model. | 454 * Removes all exceptions from the js model. |
453 */ | 455 */ |
454 reset: function() { | 456 reset: function() { |
455 if (this.isEditable()) { | 457 if (this.isEditable()) { |
456 // The null creates the Add New Exception row. | 458 // The null creates the Add New Exception row. |
457 this.dataModel = new ArrayDataModel([null]); | 459 this.dataModel = new ArrayDataModel([null]); |
458 } else { | 460 } else { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
560 } | 562 } |
561 }; | 563 }; |
562 | 564 |
563 return { | 565 return { |
564 ExceptionsListItem: ExceptionsListItem, | 566 ExceptionsListItem: ExceptionsListItem, |
565 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 567 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
566 ExceptionsList: ExceptionsList, | 568 ExceptionsList: ExceptionsList, |
567 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 569 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
568 }; | 570 }; |
569 }); | 571 }); |
OLD | NEW |