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 "components/bookmarks/browser/bookmark_model.h"
8 #include "content/public/browser/browser_thread.h"
10 using bookmarks::BookmarkModel
;
11 using bookmarks::BookmarkNode
;
12 using content::BrowserThread
;
14 BookmarkModelTask::BookmarkModelTask(BookmarkModel
* model
)
16 // Ensure the initialization of the native bookmark model.
17 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI
));
19 model_
->BlockTillLoaded();
22 BookmarkModel
* BookmarkModelTask::model() const {
26 BookmarkModelObserverTask::BookmarkModelObserverTask(
27 BookmarkModel
* bookmark_model
)
28 : BookmarkModelTask(bookmark_model
) {
29 model()->AddObserver(this);
32 BookmarkModelObserverTask::~BookmarkModelObserverTask() {
33 model()->RemoveObserver(this);
36 void BookmarkModelObserverTask::BookmarkModelLoaded(BookmarkModel
* model
,
37 bool ids_reassigned
) {}
39 void BookmarkModelObserverTask::BookmarkNodeMoved(
41 const BookmarkNode
* old_parent
,
43 const BookmarkNode
* new_parent
,
47 void BookmarkModelObserverTask::BookmarkNodeAdded(BookmarkModel
* model
,
48 const BookmarkNode
* parent
,
52 void BookmarkModelObserverTask::BookmarkNodeRemoved(
54 const BookmarkNode
* parent
,
56 const BookmarkNode
* node
,
57 const std::set
<GURL
>& removed_urls
) {
60 void BookmarkModelObserverTask::BookmarkAllUserNodesRemoved(
62 const std::set
<GURL
>& removed_urls
) {
65 void BookmarkModelObserverTask::BookmarkNodeChanged(BookmarkModel
* model
,
66 const BookmarkNode
* node
) {
69 void BookmarkModelObserverTask::BookmarkNodeFaviconChanged(
71 const BookmarkNode
* node
) {
74 void BookmarkModelObserverTask::BookmarkNodeChildrenReordered(
76 const BookmarkNode
* node
) {