Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / profiles / bookmark_model_loaded_observer.cc
blobe6e6acee5913c72fb00b67799a3b9f810e733172
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
7 #include "chrome/browser/sync/profile_sync_service_factory.h"
8 #include "components/bookmarks/browser/bookmark_model.h"
10 using bookmarks::BookmarkModel;
12 BookmarkModelLoadedObserver::BookmarkModelLoadedObserver(Profile* profile)
13 : profile_(profile) {
16 void BookmarkModelLoadedObserver::BookmarkModelChanged() {
19 void BookmarkModelLoadedObserver::BookmarkModelLoaded(BookmarkModel* model,
20 bool ids_reassigned) {
21 // Causes lazy-load if sync is enabled.
22 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
23 model->RemoveObserver(this);
24 delete this;
27 void BookmarkModelLoadedObserver::BookmarkModelBeingDeleted(
28 BookmarkModel* model) {
29 model->RemoveObserver(this);
30 delete this;