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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 | 85 |
86 // Request to view an article by url. | 86 // Request to view an article by url. |
87 // Use CreateDefaultDistillerPage() to create a default |distiller_page|. | 87 // Use CreateDefaultDistillerPage() to create a default |distiller_page|. |
88 // The provided |distiller_page| is only used if there is not already a | 88 // The provided |distiller_page| is only used if there is not already a |
89 // distillation task in progress for the given |url|. | 89 // distillation task in progress for the given |url|. |
90 virtual scoped_ptr<ViewerHandle> ViewUrl( | 90 virtual scoped_ptr<ViewerHandle> ViewUrl( |
91 ViewRequestDelegate* delegate, | 91 ViewRequestDelegate* delegate, |
92 scoped_ptr<DistillerPage> distiller_page, | 92 scoped_ptr<DistillerPage> distiller_page, |
93 const GURL& url) = 0; | 93 const GURL& url) = 0; |
94 | 94 |
95 virtual scoped_ptr<ViewerHandle> AddViewRequestDelegate( | |
nyquist
2016/01/20 16:59:08
Please add an explanatory comment as to how this i
mvendramini_hp
2016/01/21 16:54:46
Noted. I suggest we keep this pending until we sol
| |
96 ViewRequestDelegate* delegate, | |
97 const GURL& url) = 0; | |
98 | |
95 // Creates a default DistillerPage. | 99 // Creates a default DistillerPage. |
96 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( | 100 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPage( |
97 const gfx::Size& render_view_size) = 0; | 101 const gfx::Size& render_view_size) = 0; |
98 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 102 virtual scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( |
99 scoped_ptr<SourcePageHandle> handle) = 0; | 103 scoped_ptr<SourcePageHandle> handle) = 0; |
100 | 104 |
101 virtual void AddObserver(DomDistillerObserver* observer) = 0; | 105 virtual void AddObserver(DomDistillerObserver* observer) = 0; |
102 virtual void RemoveObserver(DomDistillerObserver* observer) = 0; | 106 virtual void RemoveObserver(DomDistillerObserver* observer) = 0; |
103 | 107 |
104 // Returns the DistilledPagePrefs owned by the instance of | 108 // Returns the DistilledPagePrefs owned by the instance of |
(...skipping 25 matching lines...) Expand all Loading... | |
130 bool HasEntry(const std::string& entry_id) override; | 134 bool HasEntry(const std::string& entry_id) override; |
131 std::string GetUrlForEntry(const std::string& entry_id) override; | 135 std::string GetUrlForEntry(const std::string& entry_id) override; |
132 std::vector<ArticleEntry> GetEntries() const override; | 136 std::vector<ArticleEntry> GetEntries() const override; |
133 scoped_ptr<ArticleEntry> RemoveEntry(const std::string& entry_id) override; | 137 scoped_ptr<ArticleEntry> RemoveEntry(const std::string& entry_id) override; |
134 scoped_ptr<ViewerHandle> ViewEntry(ViewRequestDelegate* delegate, | 138 scoped_ptr<ViewerHandle> ViewEntry(ViewRequestDelegate* delegate, |
135 scoped_ptr<DistillerPage> distiller_page, | 139 scoped_ptr<DistillerPage> distiller_page, |
136 const std::string& entry_id) override; | 140 const std::string& entry_id) override; |
137 scoped_ptr<ViewerHandle> ViewUrl(ViewRequestDelegate* delegate, | 141 scoped_ptr<ViewerHandle> ViewUrl(ViewRequestDelegate* delegate, |
138 scoped_ptr<DistillerPage> distiller_page, | 142 scoped_ptr<DistillerPage> distiller_page, |
139 const GURL& url) override; | 143 const GURL& url) override; |
144 scoped_ptr<ViewerHandle> AddViewRequestDelegate(ViewRequestDelegate* delegate, | |
145 const GURL& url) override; | |
140 scoped_ptr<DistillerPage> CreateDefaultDistillerPage( | 146 scoped_ptr<DistillerPage> CreateDefaultDistillerPage( |
141 const gfx::Size& render_view_size) override; | 147 const gfx::Size& render_view_size) override; |
142 scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( | 148 scoped_ptr<DistillerPage> CreateDefaultDistillerPageWithHandle( |
143 scoped_ptr<SourcePageHandle> handle) override; | 149 scoped_ptr<SourcePageHandle> handle) override; |
144 void AddObserver(DomDistillerObserver* observer) override; | 150 void AddObserver(DomDistillerObserver* observer) override; |
145 void RemoveObserver(DomDistillerObserver* observer) override; | 151 void RemoveObserver(DomDistillerObserver* observer) override; |
146 DistilledPagePrefs* GetDistilledPagePrefs() override; | 152 DistilledPagePrefs* GetDistilledPagePrefs() override; |
147 | 153 |
148 private: | 154 private: |
149 void CancelTask(TaskTracker* task); | 155 void CancelTask(TaskTracker* task); |
(...skipping 24 matching lines...) Expand all Loading... | |
174 | 180 |
175 typedef ScopedVector<TaskTracker> TaskList; | 181 typedef ScopedVector<TaskTracker> TaskList; |
176 TaskList tasks_; | 182 TaskList tasks_; |
177 | 183 |
178 DISALLOW_COPY_AND_ASSIGN(DomDistillerService); | 184 DISALLOW_COPY_AND_ASSIGN(DomDistillerService); |
179 }; | 185 }; |
180 | 186 |
181 } // namespace dom_distiller | 187 } // namespace dom_distiller |
182 | 188 |
183 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ | 189 #endif // COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_SERVICE_H_ |
OLD | NEW |