| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Request to view an article by url. | 77 // Request to view an article by url. |
| 78 // Use CreateDefaultDistillerPage() to create a default |distiller_page|. | 78 // Use CreateDefaultDistillerPage() to create a default |distiller_page|. |
| 79 // The provided |distiller_page| is only used if there is not already a | 79 // The provided |distiller_page| is only used if there is not already a |
| 80 // distillation task in progress for the given |url|. | 80 // distillation task in progress for the given |url|. |
| 81 virtual scoped_ptr<ViewerHandle> ViewUrl( | 81 virtual scoped_ptr<ViewerHandle> ViewUrl( |
| 82 ViewRequestDelegate* delegate, | 82 ViewRequestDelegate* delegate, |
| 83 scoped_ptr<DistillerPage> distiller_page, | 83 scoped_ptr<DistillerPage> distiller_page, |
| 84 const GURL& url) = 0; | 84 const GURL& url) = 0; |
| 85 | 85 |
| 86 // Creates a default DistillerPage. | 86 // Creates a default DistillerPage. |
| 87 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() = 0; | 87 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( |
| 88 const gfx::Size& render_view_size) = 0; |
| 88 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 89 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( |
| 89 scoped_ptr<SourcePageHandle> handle) = 0; | 90 scoped_ptr<SourcePageHandle> handle) = 0; |
| 90 | 91 |
| 91 virtual void AddObserver(DomDistillerObserver* observer) = 0; | 92 virtual void AddObserver(DomDistillerObserver* observer) = 0; |
| 92 virtual void RemoveObserver(DomDistillerObserver* observer) = 0; | 93 virtual void RemoveObserver(DomDistillerObserver* observer) = 0; |
| 93 | 94 |
| 94 // Returns the DistilledPagePrefs owned by the instance of | 95 // Returns the DistilledPagePrefs owned by the instance of |
| 95 // DomDistillerService. | 96 // DomDistillerService. |
| 96 virtual DistilledPagePrefs* GetDistilledPagePrefs() = 0; | 97 virtual DistilledPagePrefs* GetDistilledPagePrefs() = 0; |
| 97 | 98 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 121 virtual scoped_ptr<ArticleEntry> RemoveEntry( | 122 virtual scoped_ptr<ArticleEntry> RemoveEntry( |
| 122 const std::string& entry_id) OVERRIDE; | 123 const std::string& entry_id) OVERRIDE; |
| 123 virtual scoped_ptr<ViewerHandle> ViewEntry( | 124 virtual scoped_ptr<ViewerHandle> ViewEntry( |
| 124 ViewRequestDelegate* delegate, | 125 ViewRequestDelegate* delegate, |
| 125 scoped_ptr<DistillerPage> distiller_page, | 126 scoped_ptr<DistillerPage> distiller_page, |
| 126 const std::string& entry_id) OVERRIDE; | 127 const std::string& entry_id) OVERRIDE; |
| 127 virtual scoped_ptr<ViewerHandle> ViewUrl( | 128 virtual scoped_ptr<ViewerHandle> ViewUrl( |
| 128 ViewRequestDelegate* delegate, | 129 ViewRequestDelegate* delegate, |
| 129 scoped_ptr<DistillerPage> distiller_page, | 130 scoped_ptr<DistillerPage> distiller_page, |
| 130 const GURL& url) OVERRIDE; | 131 const GURL& url) OVERRIDE; |
| 131 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage() OVERRIDE; | 132 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( |
| 133 const gfx::Size& render_view_size) OVERRIDE; |
| 132 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 134 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( |
| 133 scoped_ptr<SourcePageHandle> handle) OVERRIDE; | 135 scoped_ptr<SourcePageHandle> handle) OVERRIDE; |
| 134 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; | 136 virtual void AddObserver(DomDistillerObserver* observer) OVERRIDE; |
| 135 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; | 137 virtual void RemoveObserver(DomDistillerObserver* observer) OVERRIDE; |
| 136 virtual DistilledPagePrefs* GetDistilledPagePrefs() OVERRIDE; | 138 virtual DistilledPagePrefs* GetDistilledPagePrefs() OVERRIDE; |
| 137 | 139 |
| 138 private: | 140 private: |
| 139 void CancelTask(TaskTracker* task); | 141 void CancelTask(TaskTracker* task); |
| 140 void AddDistilledPageToList(const ArticleEntry& entry, | 142 void AddDistilledPageToList(const ArticleEntry& entry, |
| 141 const DistilledArticleProto* article_proto, | 143 const DistilledArticleProto* article_proto, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 159 | 161 |
| 160 typedef ScopedVector<TaskTracker> TaskList; | 162 typedef ScopedVector<TaskTracker> TaskList; |
| 161 TaskList tasks_; | 163 TaskList tasks_; |
| 162 | 164 |
| 163 DISALLOW_COPY_AND_ASSIGN(DomDistillerService); | 165 DISALLOW_COPY_AND_ASSIGN(DomDistillerService); |
| 164 }; | 166 }; |
| 165 | 167 |
| 166 } // namespace dom_distiller | 168 } // namespace dom_distiller |
| 167 | 169 |
| 168 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 170 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ |
| OLD | NEW |