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

Unified Diff: chrome/browser/extensions/extension_bookmarks_module.cc

Issue 7558003: Profiles: Bookmark notifications should listen to only a specific profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pkasting nits Created 9 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
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_bookmarks_module.cc
diff --git a/chrome/browser/extensions/extension_bookmarks_module.cc b/chrome/browser/extensions/extension_bookmarks_module.cc
index 8262c508bff79269ff90e33319185d545e087c3d..2b6a154adc158bd7f715f2005c1ddd74e4ed2a4e 100644
--- a/chrome/browser/extensions/extension_bookmarks_module.cc
+++ b/chrome/browser/extensions/extension_bookmarks_module.cc
@@ -79,7 +79,7 @@ void BookmarksFunction::Run() {
if (!model->IsLoaded()) {
// Bookmarks are not ready yet. We'll wait.
registrar_.Add(this, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED,
- NotificationService::AllSources());
+ Source<Profile>(profile()));
AddRef(); // Balanced in Observe().
return;
}
@@ -113,7 +113,8 @@ bool BookmarksFunction::EditBookmarksEnabled() {
void BookmarksFunction::Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) {
- DCHECK(type == chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED);
+ DCHECK_EQ(chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, type);
+ DCHECK_EQ(profile(), Source<Profile>(source).ptr());
DCHECK(profile()->GetBookmarkModel()->IsLoaded());
Run();
Release(); // Balanced in Run().
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698