Index: chrome/browser/resources/options/content_settings_exceptions_area.js |
diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.js b/chrome/browser/resources/options/content_settings_exceptions_area.js |
index 5a0e788f38a2966eb16ee2d62086e4b4fdcc7470..b75709ce2ecc0f9231ba9fe3a0ea6e6b04aaf4c8 100644 |
--- a/chrome/browser/resources/options/content_settings_exceptions_area.js |
+++ b/chrome/browser/resources/options/content_settings_exceptions_area.js |
@@ -424,7 +424,7 @@ cr.define('options.contentSettings', function() { |
window.setTimeout(function() { |
var activeElement = doc.activeElement; |
if (!exceptionList.contains(activeElement)) |
- exceptionList.selectionModel.clear(); |
+ exceptionList.selectionModel.unselectAll(); |
}, 50); |
} |
@@ -458,16 +458,21 @@ cr.define('options.contentSettings', function() { |
}, |
/** |
- * Adds an exception to the js model. |
- * @param {Object} entry A dictionary of values for the exception. |
+ * Sets the exceptions in the js model. |
+ * @param {Object} entries A list of dictionaries of values, each dictionary |
+ * represents an exception. |
*/ |
- addException: function(entry) { |
+ setExceptions: function(entries) { |
+ var deleteCount = this.dataModel.length; |
+ |
if (this.isEditable()) { |
- // We have to add it before the Add New Exception row. |
- this.dataModel.splice(this.dataModel.length - 1, 0, entry); |
- } else { |
- this.dataModel.push(entry); |
+ // We don't want to remove the Add New Exception row. |
+ deleteCount = deleteCount - 1; |
} |
+ |
+ var args = [0, deleteCount]; |
+ args.push.apply(args, entries); |
+ this.dataModel.splice.apply(this.dataModel, args); |
}, |
/** |