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

Unified Diff: chrome/browser/resources/options2/content_settings_exceptions_area.js

Issue 10824328: Reduce number of expensive calls to List.redraw() during load of settings page. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed all comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options2/content_settings_exceptions_area.js
diff --git a/chrome/browser/resources/options2/content_settings_exceptions_area.js b/chrome/browser/resources/options2/content_settings_exceptions_area.js
index 4a460734b6bfd114ce2e2ebcd99dd1de20d4159e..b9bb96d5bab6ffef09b7bc4f94288d504a0efcda 100644
--- a/chrome/browser/resources/options2/content_settings_exceptions_area.js
+++ b/chrome/browser/resources/options2/content_settings_exceptions_area.js
@@ -522,7 +522,7 @@ cr.define('options.contentSettings', function() {
options.contentSettings.ExceptionsList.decorate(exceptionsLists[i]);
}
- ContentSettingsExceptionsArea.hideOTRLists();
+ ContentSettingsExceptionsArea.hideOTRLists(false);
// If the user types in the URL without a hash, show just cookies.
this.showList('cookies');
@@ -564,18 +564,20 @@ cr.define('options.contentSettings', function() {
* Called when the last incognito window is closed.
*/
ContentSettingsExceptionsArea.OTRProfileDestroyed = function() {
- this.hideOTRLists();
+ this.hideOTRLists(true);
};
/**
- * Clears and hides the incognito exceptions lists.
+ * Hides the incognito exceptions lists and optionally clears them as well.
+ * @param {boolean} clear Whether to clear the lists.
*/
- ContentSettingsExceptionsArea.hideOTRLists = function() {
+ ContentSettingsExceptionsArea.hideOTRLists = function(clear) {
var otrLists = document.querySelectorAll('list[mode=otr]');
for (var i = 0; i < otrLists.length; i++) {
- otrLists[i].reset();
otrLists[i].parentNode.hidden = true;
+ if (clear)
+ otrLists[i].reset();
}
};
« no previous file with comments | « chrome/browser/resources/options2/chromeos/network_list.js ('k') | chrome/browser/resources/shared/js/cr/ui/list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698