| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ | 6 #define CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ |
| 7 | 7 |
| 8 #include "components/dom_distiller/core/dom_distiller_service.h" | 8 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 9 #include "components/dom_distiller/core/task_tracker.h" | 9 #include "components/dom_distiller/core/task_tracker.h" |
| 10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 LazyDomDistillerService(Profile* profile, | 30 LazyDomDistillerService(Profile* profile, |
| 31 const DomDistillerServiceFactory* service_factory); | 31 const DomDistillerServiceFactory* service_factory); |
| 32 virtual ~LazyDomDistillerService(); | 32 virtual ~LazyDomDistillerService(); |
| 33 | 33 |
| 34 public: | 34 public: |
| 35 // DomDistillerServiceInterface implementation: | 35 // DomDistillerServiceInterface implementation: |
| 36 virtual syncer::SyncableService* GetSyncableService() const OVERRIDE; | 36 virtual syncer::SyncableService* GetSyncableService() const OVERRIDE; |
| 37 virtual const std::string AddToList( | 37 virtual const std::string AddToList( |
| 38 const GURL& url, | 38 const GURL& url, |
| 39 scoped_ptr<DistillerPage> distiller_page, |
| 39 const ArticleAvailableCallback& article_cb) OVERRIDE; | 40 const ArticleAvailableCallback& article_cb) OVERRIDE; |
| 40 virtual std::vector<ArticleEntry> GetEntries() const OVERRIDE; | 41 virtual std::vector<ArticleEntry> GetEntries() const OVERRIDE; |
| 41 virtual scoped_ptr<ArticleEntry> RemoveEntry(const std::string& entry_id) | 42 virtual scoped_ptr<ArticleEntry> RemoveEntry( |
| 42 OVERRIDE; | 43 const std::string& entry_id) OVERRIDE; |
| 43 virtual scoped_ptr<ViewerHandle> ViewEntry(ViewRequestDelegate* delegate, | 44 virtual scoped_ptr<ViewerHandle> ViewEntry( |
| 44 const std::string& entry_id) | 45 ViewRequestDelegate* delegate, |
| 45 OVERRIDE; | 46 scoped_ptr<DistillerPage> distiller_page, |
| 46 virtual scoped_ptr<ViewerHandle> ViewUrl(ViewRequestDelegate* delegate, | 47 const std::string& entry_id) OVERRIDE; |
| 47 const GURL& url) OVERRIDE; | 48 virtual scoped_ptr<ViewerHandle> ViewUrl( |
| 49 ViewRequestDelegate* delegate, |
| 50 scoped_ptr<DistillerPage> distiller_page, |
| 51 const GURL& url) OVERRIDE; |
| 52 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() OVERRIDE; |
| 48 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; | 53 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; |
| 49 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; | 54 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; |
| 50 | 55 |
| 51 private: | 56 private: |
| 52 // Accessor method for the backing service instance. | 57 // Accessor method for the backing service instance. |
| 53 DomDistillerServiceInterface* instance() const; | 58 DomDistillerServiceInterface* instance() const; |
| 54 | 59 |
| 55 // content::NotificationObserver implementation: | 60 // content::NotificationObserver implementation: |
| 56 virtual void Observe(int type, | 61 virtual void Observe(int type, |
| 57 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
| 58 const content::NotificationDetails& details) OVERRIDE; | 63 const content::NotificationDetails& details) OVERRIDE; |
| 59 | 64 |
| 60 // The Profile to use when retrieving the DomDistillerService and also the | 65 // The Profile to use when retrieving the DomDistillerService and also the |
| 61 // profile to listen for destruction of. | 66 // profile to listen for destruction of. |
| 62 Profile* profile_; | 67 Profile* profile_; |
| 63 | 68 |
| 64 // A BrowserContextKeyedServiceFactory for the DomDistillerService. | 69 // A BrowserContextKeyedServiceFactory for the DomDistillerService. |
| 65 const DomDistillerServiceFactory* service_factory_; | 70 const DomDistillerServiceFactory* service_factory_; |
| 66 | 71 |
| 67 // Used to track when the profile is shut down. | 72 // Used to track when the profile is shut down. |
| 68 content::NotificationRegistrar registrar_; | 73 content::NotificationRegistrar registrar_; |
| 69 | 74 |
| 70 DISALLOW_COPY_AND_ASSIGN(LazyDomDistillerService); | 75 DISALLOW_COPY_AND_ASSIGN(LazyDomDistillerService); |
| 71 }; | 76 }; |
| 72 | 77 |
| 73 } // namespace dom_distiller | 78 } // namespace dom_distiller |
| 74 | 79 |
| 75 #endif // CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ | 80 #endif // CHROME_BROWSER_DOM_DISTILLER_LAZY_DOM_DISTILLER_SERVICE_H_ |
| OLD | NEW |