// Copyright (c) 2012 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. #ifndef CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_ #define CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_ #pragma once #include "base/basictypes.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" // BookmarkLoadObserver is used when blocking until the BookmarkModel // finishes loading. As soon as the BookmarkModel finishes loading the message // loop is quit. class BookmarkLoadObserver : public BookmarkModelObserver { public: explicit BookmarkLoadObserver(const base::Closure& quit_task); virtual ~BookmarkLoadObserver(); virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE; virtual void BookmarkNodeMoved(BookmarkModel* model, const BookmarkNode* old_parent, int old_index, const BookmarkNode* new_parent, int new_index) OVERRIDE {} virtual void BookmarkNodeAdded(BookmarkModel* model, const BookmarkNode* parent, int index) OVERRIDE{} virtual void BookmarkNodeRemoved(BookmarkModel* model, const BookmarkNode* parent, int old_index, const BookmarkNode* node) OVERRIDE {} virtual void BookmarkNodeChanged(BookmarkModel* model, const BookmarkNode* node) OVERRIDE {} virtual void BookmarkNodeChildrenReordered( BookmarkModel* model, const BookmarkNode* node) OVERRIDE {} virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, const BookmarkNode* node) OVERRIDE {} private: base::Closure quit_task_; DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver); }; #endif // CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_