Skip to content

Commit

Permalink
Fix a bug where ContentSettingsHandler did not listen for OTR content…
Browse files Browse the repository at this point in the history
… settings changes.

BUG=415944

Review URL: https://codereview.chromium.org/585953003

Cr-Commit-Position: refs/heads/master@{#296044}
  • Loading branch information
dhnishi authored and Commit bot committed Sep 22, 2014
1 parent be94763 commit 3d148e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chrome/browser/ui/webui/options/content_settings_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,21 @@ void ContentSettingsHandler::Observe(
const content::NotificationDetails& details) {
switch (type) {
case chrome::NOTIFICATION_PROFILE_DESTROYED: {
if (content::Source<Profile>(source).ptr()->IsOffTheRecord()) {
Profile* profile = content::Source<Profile>(source).ptr();
if (profile->IsOffTheRecord()) {
web_ui()->CallJavascriptFunction(
"ContentSettingsExceptionsArea.OTRProfileDestroyed");
observer_.Remove(profile->GetHostContentSettingsMap());
}
break;
}

case chrome::NOTIFICATION_PROFILE_CREATED: {
if (content::Source<Profile>(source).ptr()->IsOffTheRecord())
Profile* profile = content::Source<Profile>(source).ptr();
if (profile->IsOffTheRecord()) {
UpdateAllOTRExceptionsViewsFromModel();
observer_.Add(profile->GetHostContentSettingsMap());
}
break;
}

Expand Down

0 comments on commit 3d148e7

Please sign in to comment.