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

Side by Side Diff: ui/webui/resources/js/cr/ui/array_data_model.js

Issue 1962163002: Revert of [Chrome Settings UI] If User Exceptions are not allowed, prevent editing / viewing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | 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 /** 5 /**
6 * @fileoverview This is a data model representin 6 * @fileoverview This is a data model representin
7 */ 7 */
8 8
9 // The include directives are put into Javascript-style comments to prevent 9 // The include directives are put into Javascript-style comments to prevent
10 // parsing errors in non-flattened mode. The flattener still sees them. 10 // parsing errors in non-flattened mode. The flattener still sees them.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 * @return {number} The new length of the model. 215 * @return {number} The new length of the model.
216 */ 216 */
217 push: function(var_args) { 217 push: function(var_args) {
218 var args = Array.prototype.slice.call(arguments); 218 var args = Array.prototype.slice.call(arguments);
219 args.unshift(this.length, 0); 219 args.unshift(this.length, 0);
220 this.splice.apply(this, args); 220 this.splice.apply(this, args);
221 return this.length; 221 return this.length;
222 }, 222 },
223 223
224 /** 224 /**
225 * Removes and returns the last item of the model.
226 *
227 * This dispatches a splice event.
228 *
229 * @return {*} The last item, or undefined if model has no more items.
230 */
231 pop: function() {
232 return this.splice(this.array_.length - 1, 1)[0];
233 },
234
235 /**
236 * Updates the existing item with the new item. 225 * Updates the existing item with the new item.
237 * 226 *
238 * The existing item and the new item are regarded as the same item and the 227 * The existing item and the new item are regarded as the same item and the
239 * permutation tracks these indexes. 228 * permutation tracks these indexes.
240 * 229 *
241 * @param {*} oldItem Old item that is contained in the model. If the item 230 * @param {*} oldItem Old item that is contained in the model. If the item
242 * is not found in the model, the method call is just ignored. 231 * is not found in the model, the method call is just ignored.
243 * @param {*} newItem New item. 232 * @param {*} newItem New item.
244 */ 233 */
245 replaceItem: function(oldItem, newItem) { 234 replaceItem: function(oldItem, newItem) {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 if (a > b) 441 if (a > b)
453 return 1; 442 return 1;
454 return 0; 443 return 0;
455 } 444 }
456 }; 445 };
457 446
458 return { 447 return {
459 ArrayDataModel: ArrayDataModel 448 ArrayDataModel: ArrayDataModel
460 }; 449 };
461 }); 450 });
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698