1 // Copyright (c) 2012 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/android/provider/bookmark_model_observer_task.h"
7 #include "chrome/browser/bookmarks/bookmark_model.h"
8 #include "content/public/browser/browser_thread.h"
10 using content::BrowserThread
;
12 BookmarkModelTask::BookmarkModelTask(BookmarkModel
* model
)
14 // Ensure the initialization of the native bookmark model.
15 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI
));
17 model_
->BlockTillLoaded();
20 BookmarkModel
* BookmarkModelTask::model() const {
24 BookmarkModelObserverTask::BookmarkModelObserverTask(
25 BookmarkModel
* bookmark_model
)
26 : BookmarkModelTask(bookmark_model
) {
27 model()->AddObserver(this);
30 BookmarkModelObserverTask::~BookmarkModelObserverTask() {
31 model()->RemoveObserver(this);
34 void BookmarkModelObserverTask::Loaded(BookmarkModel
* model
,
35 bool ids_reassigned
) {
38 void BookmarkModelObserverTask::BookmarkNodeMoved(
40 const BookmarkNode
* old_parent
,
42 const BookmarkNode
* new_parent
,
46 void BookmarkModelObserverTask::BookmarkNodeAdded(BookmarkModel
* model
,
47 const BookmarkNode
* parent
,
51 void BookmarkModelObserverTask::BookmarkNodeRemoved(BookmarkModel
* model
,
52 const BookmarkNode
* parent
,
54 const BookmarkNode
* node
) {
57 void BookmarkModelObserverTask::BookmarkAllNodesRemoved(BookmarkModel
* model
) {}
59 void BookmarkModelObserverTask::BookmarkNodeChanged(BookmarkModel
* model
,
60 const BookmarkNode
* node
) {}
62 void BookmarkModelObserverTask::BookmarkNodeFaviconChanged(
64 const BookmarkNode
* node
) {
67 void BookmarkModelObserverTask::BookmarkNodeChildrenReordered(
69 const BookmarkNode
* node
) {