Home | History | Annotate | Download | only in base
      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.
      4 
      5 #ifndef CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_
      6 #define CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/callback.h"
     10 #include "base/compiler_specific.h"
     11 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
     12 
     13 // BookmarkLoadObserver is used when blocking until the BookmarkModel finishes
     14 // loading. As soon as the BookmarkModel finishes loading the message loop is
     15 // quit.
     16 class BookmarkLoadObserver : public BaseBookmarkModelObserver {
     17  public:
     18   explicit BookmarkLoadObserver(const base::Closure& quit_task);
     19   virtual ~BookmarkLoadObserver();
     20 
     21  private:
     22   // BaseBookmarkModelObserver:
     23   virtual void BookmarkModelChanged() OVERRIDE;
     24   virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE;
     25 
     26   base::Closure quit_task_;
     27 
     28   DISALLOW_COPY_AND_ASSIGN(BookmarkLoadObserver);
     29 };
     30 
     31 #endif  // CHROME_TEST_BASE_BOOKMARK_LOAD_OBSERVER_H_
     32