| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 
| 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 114 // Provide a view of the article list and ways of interacting with it. | 114 // Provide a view of the article list and ways of interacting with it. | 
| 115 class DomDistillerService : public DomDistillerServiceInterface { | 115 class DomDistillerService : public DomDistillerServiceInterface { | 
| 116  public: | 116  public: | 
| 117   DomDistillerService(scoped_ptr<DomDistillerStoreInterface> store, | 117   DomDistillerService(scoped_ptr<DomDistillerStoreInterface> store, | 
| 118                       scoped_ptr<DistillerFactory> distiller_factory, | 118                       scoped_ptr<DistillerFactory> distiller_factory, | 
| 119                       scoped_ptr<DistillerPageFactory> distiller_page_factory, | 119                       scoped_ptr<DistillerPageFactory> distiller_page_factory, | 
| 120                       scoped_ptr<DistilledPagePrefs> distilled_page_prefs); | 120                       scoped_ptr<DistilledPagePrefs> distilled_page_prefs); | 
| 121   virtual ~DomDistillerService(); | 121   virtual ~DomDistillerService(); | 
| 122 | 122 | 
| 123   // DomDistillerServiceInterface implementation. | 123   // DomDistillerServiceInterface implementation. | 
| 124   virtual syncer::SyncableService* GetSyncableService() const OVERRIDE; | 124   virtual syncer::SyncableService* GetSyncableService() const override; | 
| 125   virtual const std::string AddToList( | 125   virtual const std::string AddToList( | 
| 126       const GURL& url, | 126       const GURL& url, | 
| 127       scoped_ptr<DistillerPage> distiller_page, | 127       scoped_ptr<DistillerPage> distiller_page, | 
| 128       const ArticleAvailableCallback& article_cb) OVERRIDE; | 128       const ArticleAvailableCallback& article_cb) override; | 
| 129   virtual bool HasEntry(const std::string& entry_id) OVERRIDE; | 129   virtual bool HasEntry(const std::string& entry_id) override; | 
| 130   virtual std::string GetUrlForEntry(const std::string& entry_id) OVERRIDE; | 130   virtual std::string GetUrlForEntry(const std::string& entry_id) override; | 
| 131   virtual std::vector<ArticleEntry> GetEntries() const OVERRIDE; | 131   virtual std::vector<ArticleEntry> GetEntries() const override; | 
| 132   virtual scoped_ptr<ArticleEntry> RemoveEntry( | 132   virtual scoped_ptr<ArticleEntry> RemoveEntry( | 
| 133       const std::string& entry_id) OVERRIDE; | 133       const std::string& entry_id) override; | 
| 134   virtual scoped_ptr<ViewerHandle> ViewEntry( | 134   virtual scoped_ptr<ViewerHandle> ViewEntry( | 
| 135       ViewRequestDelegate* delegate, | 135       ViewRequestDelegate* delegate, | 
| 136       scoped_ptr<DistillerPage> distiller_page, | 136       scoped_ptr<DistillerPage> distiller_page, | 
| 137       const std::string& entry_id) OVERRIDE; | 137       const std::string& entry_id) override; | 
| 138   virtual scoped_ptr<ViewerHandle> ViewUrl( | 138   virtual scoped_ptr<ViewerHandle> ViewUrl( | 
| 139       ViewRequestDelegate* delegate, | 139       ViewRequestDelegate* delegate, | 
| 140       scoped_ptr<DistillerPage> distiller_page, | 140       scoped_ptr<DistillerPage> distiller_page, | 
| 141       const GURL& url) OVERRIDE; | 141       const GURL& url) override; | 
| 142   virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( | 142   virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( | 
| 143       const gfx::Size& render_view_size) OVERRIDE; | 143       const gfx::Size& render_view_size) override; | 
| 144   virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 144   virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 
| 145       scoped_ptr<SourcePageHandle> handle) OVERRIDE; | 145       scoped_ptr<SourcePageHandle> handle) override; | 
| 146   virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; | 146   virtual void AddObserver(DomDistillerObserver* observer) override; | 
| 147   virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; | 147   virtual void RemoveObserver(DomDistillerObserver* observer) override; | 
| 148   virtual DistilledPagePrefs* GetDistilledPagePrefs() OVERRIDE; | 148   virtual DistilledPagePrefs* GetDistilledPagePrefs() override; | 
| 149 | 149 | 
| 150  private: | 150  private: | 
| 151   void CancelTask(TaskTracker* task); | 151   void CancelTask(TaskTracker* task); | 
| 152   void AddDistilledPageToList(const ArticleEntry& entry, | 152   void AddDistilledPageToList(const ArticleEntry& entry, | 
| 153                               const DistilledArticleProto* article_proto, | 153                               const DistilledArticleProto* article_proto, | 
| 154                               bool distillation_succeeded); | 154                               bool distillation_succeeded); | 
| 155 | 155 | 
| 156   TaskTracker* CreateTaskTracker(const ArticleEntry& entry); | 156   TaskTracker* CreateTaskTracker(const ArticleEntry& entry); | 
| 157 | 157 | 
| 158   TaskTracker* GetTaskTrackerForEntry(const ArticleEntry& entry) const; | 158   TaskTracker* GetTaskTrackerForEntry(const ArticleEntry& entry) const; | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 171 | 171 | 
| 172   typedef ScopedVector<TaskTracker> TaskList; | 172   typedef ScopedVector<TaskTracker> TaskList; | 
| 173   TaskList tasks_; | 173   TaskList tasks_; | 
| 174 | 174 | 
| 175   DISALLOW_COPY_AND_ASSIGN(DomDistillerService); | 175   DISALLOW_COPY_AND_ASSIGN(DomDistillerService); | 
| 176 }; | 176 }; | 
| 177 | 177 | 
| 178 }  // namespace dom_distiller | 178 }  // namespace dom_distiller | 
| 179 | 179 | 
| 180 #endif  // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 180 #endif  // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 
| OLD | NEW | 
|---|