Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / android / provider / bookmark_model_observer_task.cc
blob2e20366b0d9604aa4d0bb7b1fe88c1432841ec40
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)
15 : model_(model) {
16 // Ensure the initialization of the native bookmark model.
17 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
18 DCHECK(model_);
19 model_->BlockTillLoaded();
22 BookmarkModel* BookmarkModelTask::model() const {
23 return model_;
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(
40 BookmarkModel* model,
41 const BookmarkNode* old_parent,
42 int old_index,
43 const BookmarkNode* new_parent,
44 int new_index) {
47 void BookmarkModelObserverTask::BookmarkNodeAdded(BookmarkModel* model,
48 const BookmarkNode* parent,
49 int index) {
52 void BookmarkModelObserverTask::BookmarkNodeRemoved(
53 BookmarkModel* model,
54 const BookmarkNode* parent,
55 int old_index,
56 const BookmarkNode* node,
57 const std::set<GURL>& removed_urls) {
60 void BookmarkModelObserverTask::BookmarkAllUserNodesRemoved(
61 BookmarkModel* model,
62 const std::set<GURL>& removed_urls) {
65 void BookmarkModelObserverTask::BookmarkNodeChanged(BookmarkModel* model,
66 const BookmarkNode* node) {
69 void BookmarkModelObserverTask::BookmarkNodeFaviconChanged(
70 BookmarkModel* model,
71 const BookmarkNode* node) {
74 void BookmarkModelObserverTask::BookmarkNodeChildrenReordered(
75 BookmarkModel* model,
76 const BookmarkNode* node) {