| OLD | NEW |
| 1 // Copyright (c) 2011 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 InlineEditableItemList = options.InlineEditableItemList; | 6 const InlineEditableItemList = options.InlineEditableItemList; |
| 7 const InlineEditableItem = options.InlineEditableItem; | 7 const InlineEditableItem = options.InlineEditableItem; |
| 8 const ArrayDataModel = cr.ui.ArrayDataModel; | 8 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 select.appendChild(optionAsk); | 75 select.appendChild(optionAsk); |
| 76 } | 76 } |
| 77 | 77 |
| 78 if (this.contentType == 'cookies') { | 78 if (this.contentType == 'cookies') { |
| 79 var optionSession = cr.doc.createElement('option'); | 79 var optionSession = cr.doc.createElement('option'); |
| 80 optionSession.textContent = templateData.sessionException; | 80 optionSession.textContent = templateData.sessionException; |
| 81 optionSession.value = 'session'; | 81 optionSession.value = 'session'; |
| 82 select.appendChild(optionSession); | 82 select.appendChild(optionSession); |
| 83 } | 83 } |
| 84 | 84 |
| 85 var optionBlock = cr.doc.createElement('option'); | 85 if (this.contentType != 'fullscreen') { |
| 86 optionBlock.textContent = templateData.blockException; | 86 var optionBlock = cr.doc.createElement('option'); |
| 87 optionBlock.value = 'block'; | 87 optionBlock.textContent = templateData.blockException; |
| 88 select.appendChild(optionBlock); | 88 optionBlock.value = 'block'; |
| 89 select.appendChild(optionBlock); |
| 90 } |
| 89 | 91 |
| 90 this.contentElement.appendChild(select); | 92 this.contentElement.appendChild(select); |
| 91 select.className = 'exception-setting'; | 93 select.className = 'exception-setting'; |
| 92 if (this.pattern) | 94 if (this.pattern) |
| 93 select.setAttribute('displaymode', 'edit'); | 95 select.setAttribute('displaymode', 'edit'); |
| 94 | 96 |
| 95 // Used to track whether the URL pattern in the input is valid. | 97 // Used to track whether the URL pattern in the input is valid. |
| 96 // This will be true if the browser process has informed us that the | 98 // This will be true if the browser process has informed us that the |
| 97 // current text in the input is valid. Changing the text resets this to | 99 // current text in the input is valid. Changing the text resets this to |
| 98 // false, and getting a response from the browser sets it back to true. | 100 // false, and getting a response from the browser sets it back to true. |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 listItem.setPatternValid(valid); | 423 listItem.setPatternValid(valid); |
| 422 } | 424 } |
| 423 }, | 425 }, |
| 424 | 426 |
| 425 /** | 427 /** |
| 426 * Returns whether the rows are editable in this list. | 428 * Returns whether the rows are editable in this list. |
| 427 */ | 429 */ |
| 428 isEditable: function() { | 430 isEditable: function() { |
| 429 // Editing notifications and geolocation is disabled for now. | 431 // Editing notifications and geolocation is disabled for now. |
| 430 return !(this.contentType == 'notifications' || | 432 return !(this.contentType == 'notifications' || |
| 431 this.contentType == 'location'); | 433 this.contentType == 'location' || |
| 434 this.contentType == 'fullscreen'); |
| 432 }, | 435 }, |
| 433 | 436 |
| 434 /** | 437 /** |
| 435 * Removes all exceptions from the js model. | 438 * Removes all exceptions from the js model. |
| 436 */ | 439 */ |
| 437 reset: function() { | 440 reset: function() { |
| 438 if (this.isEditable()) { | 441 if (this.isEditable()) { |
| 439 // The null creates the Add New Exception row. | 442 // The null creates the Add New Exception row. |
| 440 this.dataModel = new ArrayDataModel([null]); | 443 this.dataModel = new ArrayDataModel([null]); |
| 441 } else { | 444 } else { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 } | 543 } |
| 541 }; | 544 }; |
| 542 | 545 |
| 543 return { | 546 return { |
| 544 ExceptionsListItem: ExceptionsListItem, | 547 ExceptionsListItem: ExceptionsListItem, |
| 545 ExceptionsAddRowListItem: ExceptionsAddRowListItem, | 548 ExceptionsAddRowListItem: ExceptionsAddRowListItem, |
| 546 ExceptionsList: ExceptionsList, | 549 ExceptionsList: ExceptionsList, |
| 547 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, | 550 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, |
| 548 }; | 551 }; |
| 549 }); | 552 }); |
| OLD | NEW |