summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 07:58:59 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 07:58:59 +0000
commit098c743d39e22651d2358ea7829a2fc2e3cd92cc (patch)
tree269d5da30b9d79a281e0cb0583530bfddf81ed0d /chrome/browser
parent39a6e6f74ed780dd1dd07fffcd7c5270a1ff462f (diff)
downloadchromium_src-098c743d39e22651d2358ea7829a2fc2e3cd92cc.zip
chromium_src-098c743d39e22651d2358ea7829a2fc2e3cd92cc.tar.gz
chromium_src-098c743d39e22651d2358ea7829a2fc2e3cd92cc.tar.bz2
Make PROFILE_DESTROYED notifications work with OTR profiles.
BUG=none TEST=none Review URL: http://codereview.chromium.org/1848003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer.cc4
-rw-r--r--chrome/browser/host_content_settings_map.cc5
-rw-r--r--chrome/browser/profile.cc6
3 files changed, 10 insertions, 5 deletions
diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
index 40651ce..d3df9b4 100644
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/profile.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_source.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "net/base/file_stream.h"
@@ -372,7 +373,7 @@ BookmarkFaviconFetcher::BookmarkFaviconFetcher(
favicons_map_.reset(new URLFaviconMap());
registrar_.Add(this,
NotificationType::PROFILE_DESTROYED,
- NotificationService::AllSources());
+ Source<Profile>(profile_));
}
BookmarkFaviconFetcher::~BookmarkFaviconFetcher() {
@@ -483,4 +484,3 @@ void WriteBookmarks(Profile* profile,
}
} // namespace bookmark_html_writer
-
diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc
index 40c117e..3094477 100644
--- a/chrome/browser/host_content_settings_map.cc
+++ b/chrome/browser/host_content_settings_map.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/scoped_pref_update.h"
#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_source.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -193,7 +194,7 @@ HostContentSettingsMap::HostContentSettingsMap(Profile* profile)
prefs->AddPrefObserver(prefs::kBlockThirdPartyCookies, this);
}
notification_registrar_.Add(this, NotificationType::PROFILE_DESTROYED,
- NotificationService::AllSources());
+ Source<Profile>(profile_));
}
// static
@@ -613,6 +614,6 @@ void HostContentSettingsMap::UnregisterObservers() {
prefs->RemovePrefObserver(prefs::kBlockThirdPartyCookies, this);
}
notification_registrar_.Remove(this, NotificationType::PROFILE_DESTROYED,
- NotificationService::AllSources());
+ Source<Profile>(profile_));
profile_ = NULL;
}
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 98bae1d..e4f2bd0 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -244,7 +244,11 @@ class OffTheRecordProfileImpl : public Profile,
}
virtual ~OffTheRecordProfileImpl() {
- CleanupRequestContext(request_context_);
+ NotificationService::current()->Notify(
+ NotificationType::PROFILE_DESTROYED,
+ Source<Profile>(this),
+ NotificationService::NoDetails());
+ CleanupRequestContext(request_context_);
}
virtual ProfileId GetRuntimeId() {