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

Unified Diff: chrome/browser/bookmarks/bookmark_expanded_state_tracker.cc

Issue 10399087: Converting BookmarkModel and HistoryService to ProfileKeyedServices. This just performs the initial… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
Index: chrome/browser/bookmarks/bookmark_expanded_state_tracker.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_expanded_state_tracker.cc (revision 141067)
+++ chrome/browser/bookmarks/bookmark_expanded_state_tracker.cc (working copy)
@@ -10,15 +10,16 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
-BookmarkExpandedStateTracker::BookmarkExpandedStateTracker(Profile* profile,
- const char* path)
+BookmarkExpandedStateTracker::BookmarkExpandedStateTracker(
+ Profile* profile,
+ const char* path,
+ BookmarkModel* bookmark_model)
: profile_(profile),
pref_path_(path) {
- profile_->GetBookmarkModel()->AddObserver(this);
+ bookmark_model->AddObserver(this);
}
BookmarkExpandedStateTracker::~BookmarkExpandedStateTracker() {
- profile_->GetBookmarkModel()->RemoveObserver(this);
}
void BookmarkExpandedStateTracker::SetExpandedNodes(const Nodes& nodes) {
@@ -71,6 +72,7 @@
void BookmarkExpandedStateTracker::BookmarkModelBeingDeleted(
BookmarkModel* model) {
+ model->RemoveObserver(this);
}
void BookmarkExpandedStateTracker::BookmarkNodeRemoved(
« no previous file with comments | « chrome/browser/bookmarks/bookmark_expanded_state_tracker.h ('k') | chrome/browser/bookmarks/bookmark_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698