Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/resources/options/content_settings_exceptions_area.js

Issue 1047793002: Web MIDI API: disallow to add custom exceptions on content settings UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // This one tracks the actual validity of the pattern in the input. This 145 // This one tracks the actual validity of the pattern in the input. This
146 // starts off as true so as not to annoy the user when he adds a new and 146 // starts off as true so as not to annoy the user when he adds a new and
147 // empty input. 147 // empty input.
148 this.inputIsValid = true; 148 this.inputIsValid = true;
149 149
150 this.input = input; 150 this.input = input;
151 this.select = select; 151 this.select = select;
152 152
153 this.updateEditables(); 153 this.updateEditables();
154 154
155 // Editing notifications, geolocation and media-stream is disabled for 155 // Editing notifications, geolocation, media-stream, and midi-sysex is
156 // now. 156 // disabled for now.
157 if (this.contentType == 'notifications' || 157 if (this.contentType == 'notifications' ||
158 this.contentType == 'location' || 158 this.contentType == 'location' ||
159 this.contentType == 'media-stream') { 159 this.contentType == 'media-stream' ||
160 this.contentType == 'midi-sysex') {
Dan Beam 2015/03/30 22:10:27 any idea why zoomlevels isn't in this list? if it
160 this.editable = false; 161 this.editable = false;
161 } 162 }
162 163
163 // If the source of the content setting exception is not a user 164 // If the source of the content setting exception is not a user
164 // preference, that source controls the exception and the user cannot edit 165 // preference, that source controls the exception and the user cannot edit
165 // or delete it. 166 // or delete it.
166 var controlledBy = 167 var controlledBy =
167 this.dataItem.source && this.dataItem.source != 'preference' ? 168 this.dataItem.source && this.dataItem.source != 'preference' ?
168 this.dataItem.source : null; 169 this.dataItem.source : null;
169 170
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 538
538 /** 539 /**
539 * Returns whether the rows are editable in this list. 540 * Returns whether the rows are editable in this list.
540 */ 541 */
541 isEditable: function() { 542 isEditable: function() {
542 // Exceptions of the following lists are not editable for now. 543 // Exceptions of the following lists are not editable for now.
543 return !(this.contentType == 'notifications' || 544 return !(this.contentType == 'notifications' ||
544 this.contentType == 'location' || 545 this.contentType == 'location' ||
545 this.contentType == 'fullscreen' || 546 this.contentType == 'fullscreen' ||
546 this.contentType == 'media-stream' || 547 this.contentType == 'media-stream' ||
548 this.contentType == 'midi-sysex' ||
547 this.contentType == 'zoomlevels'); 549 this.contentType == 'zoomlevels');
548 }, 550 },
549 551
550 /** 552 /**
551 * Removes all exceptions from the js model. 553 * Removes all exceptions from the js model.
552 */ 554 */
553 reset: function() { 555 reset: function() {
554 if (this.isEditable()) { 556 if (this.isEditable()) {
555 // The null creates the Add New Exception row. 557 // The null creates the Add New Exception row.
556 this.dataModel = new ArrayDataModel([null]); 558 this.dataModel = new ArrayDataModel([null]);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 } 674 }
673 }; 675 };
674 676
675 return { 677 return {
676 ExceptionsListItem: ExceptionsListItem, 678 ExceptionsListItem: ExceptionsListItem,
677 ExceptionsAddRowListItem: ExceptionsAddRowListItem, 679 ExceptionsAddRowListItem: ExceptionsAddRowListItem,
678 ExceptionsList: ExceptionsList, 680 ExceptionsList: ExceptionsList,
679 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea, 681 ContentSettingsExceptionsArea: ContentSettingsExceptionsArea,
680 }; 682 };
681 }); 683 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698