summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profiles/bookmark_model_loaded_observer.cc
blob: 56c1135530403940e94509efa797469c66ceb16e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/profiles/bookmark_model_loaded_observer.h"

#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"

BookmarkModelLoadedObserver::BookmarkModelLoadedObserver(Profile* profile)
    : profile_(profile) {
}

void BookmarkModelLoadedObserver::BookmarkModelChanged() {
}

void BookmarkModelLoadedObserver::Loaded(BookmarkModel* model,
                                         bool ids_reassigned) {
  // Causes lazy-load if sync is enabled.
  ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
  model->RemoveObserver(this);
  delete this;
}

void BookmarkModelLoadedObserver::BookmarkModelBeingDeleted(
    BookmarkModel* model) {
  model->RemoveObserver(this);
  delete this;
}