diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 08:05:54 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-04 08:05:54 +0000 |
commit | 045903222332cbe0756da6908cfd9c5882872907 (patch) | |
tree | 2d001ed18fa46ea62f0b8fca0fea25be36e0f2c4 | |
parent | 098c743d39e22651d2358ea7829a2fc2e3cd92cc (diff) | |
download | chromium_src-045903222332cbe0756da6908cfd9c5882872907.zip chromium_src-045903222332cbe0756da6908cfd9c5882872907.tar.gz chromium_src-045903222332cbe0756da6908cfd9c5882872907.tar.bz2 |
Enable preference change notifications for OTR HostContentSettingsMap s.t. changes to the content settings actually take effect. Make sure we access the original profile when displaying the host content settings dialog.
BUG=42887
TEST=manual
Review URL: http://codereview.chromium.org/1868001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46336 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/host_content_settings_map.cc | 18 |
2 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d65674e..fe0648c 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2649,7 +2649,8 @@ void Browser::ShowRepostFormWarningDialog(TabContents *tab_contents) { } void Browser::ShowContentSettingsWindow(ContentSettingsType content_type) { - window()->ShowContentSettingsWindow(content_type, profile_); + window()->ShowContentSettingsWindow(content_type, + profile_->GetOriginalProfile()); } bool Browser::ShouldAddNavigationsToHistory() const { diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc index 3094477..edb8651 100644 --- a/chrome/browser/host_content_settings_map.cc +++ b/chrome/browser/host_content_settings_map.cc @@ -188,11 +188,9 @@ HostContentSettingsMap::HostContentSettingsMap(Profile* profile) // Read exceptions. ReadExceptions(false); - if (!is_off_the_record_) { - prefs->AddPrefObserver(prefs::kDefaultContentSettings, this); - prefs->AddPrefObserver(prefs::kContentSettingsPatterns, this); - prefs->AddPrefObserver(prefs::kBlockThirdPartyCookies, this); - } + prefs->AddPrefObserver(prefs::kDefaultContentSettings, this); + prefs->AddPrefObserver(prefs::kContentSettingsPatterns, this); + prefs->AddPrefObserver(prefs::kBlockThirdPartyCookies, this); notification_registrar_.Add(this, NotificationType::PROFILE_DESTROYED, Source<Profile>(profile_)); } @@ -607,12 +605,10 @@ void HostContentSettingsMap::UnregisterObservers() { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); if (!profile_) return; - if (!is_off_the_record_) { - PrefService* prefs = profile_->GetPrefs(); - prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); - prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); - prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); - } + PrefService* prefs = profile_->GetPrefs(); + prefs->RemovePrefObserver(prefs::kDefaultContentSettings, this); + prefs->RemovePrefObserver(prefs::kContentSettingsPatterns, this); + prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this); notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED, Source<Profile>(profile_)); profile_ = NULL; |