#ifndef CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_
#define CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_
#include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/dom_distiller/core/task_tracker.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
namespace content {
class NotificationSource;
class NotificationDetails;
}
class Profile;
namespace dom_distiller {
class DomDistillerServiceFactory;
class LazyDomDistillerService : public DomDistillerServiceInterface,
public content::NotificationObserver {
public:
LazyDomDistillerService(Profile* profile,
const DomDistillerServiceFactory* service_factory);
virtual ~LazyDomDistillerService();
public:
virtual syncer::SyncableService* GetSyncableService() const OVERRIDE;
virtual const std::string AddToList(
const GURL& url,
const ArticleAvailableCallback& article_cb) OVERRIDE;
virtual std::vector<ArticleEntry> GetEntries() const OVERRIDE;
virtual scoped_ptr<ArticleEntry> RemoveEntry(const std::string& entry_id)
OVERRIDE;
virtual scoped_ptr<ViewerHandle> ViewEntry(ViewRequestDelegate* delegate,
const std::string& entry_id)
OVERRIDE;
virtual scoped_ptr<ViewerHandle> ViewUrl(ViewRequestDelegate* delegate,
const GURL& url) OVERRIDE;
virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE;
virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE;
private:
DomDistillerServiceInterface* instance() const;
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
Profile* profile_;
const DomDistillerServiceFactory* service_factory_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(LazyDomDistillerService);
};
}
#endif