diff options
author | finnur <finnur@chromium.org> | 2015-12-16 14:42:15 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-16 22:43:32 +0000 |
commit | 3b7c3e37ec089dc5179359a52a7b2311285c7f21 (patch) | |
tree | 59682cdc004c2ac2da88a95458666de4d673802c | |
parent | 76ebe14aeee04f02c62273c638e110f621c162aa (diff) | |
download | chromium_src-3b7c3e37ec089dc5179359a52a7b2311285c7f21.zip chromium_src-3b7c3e37ec089dc5179359a52a7b2311285c7f21.tar.gz chromium_src-3b7c3e37ec089dc5179359a52a7b2311285c7f21.tar.bz2 |
Fix Allow list not opening automatically on startup
and simplify SiteList logic a bit.
BUG=543635
Review URL: https://codereview.chromium.org/1530953002
Cr-Commit-Position: refs/heads/master@{#365648}
-rw-r--r-- | chrome/browser/resources/settings/site_settings/site_list.js | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/chrome/browser/resources/settings/site_settings/site_list.js b/chrome/browser/resources/settings/site_settings/site_list.js index 3b0debf..0948e8a 100644 --- a/chrome/browser/resources/settings/site_settings/site_list.js +++ b/chrome/browser/resources/settings/site_settings/site_list.js @@ -64,14 +64,6 @@ Polymer({ }, /** - * Whether this class has initialized or not. - */ - initialized_: { - type: Boolean, - value: false, - }, - - /** * Whether to show the Allow action in the action menu. */ showAllowAction_: Boolean, @@ -111,27 +103,22 @@ Polymer({ 'onCategoryChanged_(prefs.profile.content_settings.exceptions.*, category)', ], + ready: function() { + CrSettingsPrefs.initialized.then(function() { + this.initialize_(); + }.bind(this)); + }, + /** * One-time initialization routines for this class. - * @return {boolean} True if fully initialized, false otherwise. * @private */ initialize_: function() { - if (this.initialized_) - return true; - - if (this.categoryEnabled === undefined) - return false; - if (this.categorySubtype === undefined) - return false; - this.setUpActionMenu_(); - if (this.categorySubtype == settings.PermissionValues.ALLOW) + if (this.categorySubtype == settings.PermissionValues.ALLOW) { this.$.category.opened = true; - - this.initialized_ = true; - return true; + } }, /** @@ -140,8 +127,7 @@ Polymer({ * @private */ onCategoryChanged_: function() { - if (this.initialize_()) - this.populateList_(); + this.populateList_(); }, /** @@ -150,9 +136,6 @@ Polymer({ * @private */ onDataChanged_: function(newValue, oldValue) { - if (!this.initialize_()) - return; - this.$.category.hidden = !this.showSiteList_(this.sites_, this.categoryEnabled); }, |