OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ | 5 #ifndef IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ |
6 #define IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ | 6 #define IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class DistillerViewer : public DomDistillerRequestViewBase { | 27 class DistillerViewer : public DomDistillerRequestViewBase { |
28 public: | 28 public: |
29 typedef base::Callback<void(const GURL&, const std::string&)> | 29 typedef base::Callback<void(const GURL&, const std::string&)> |
30 DistillationFinishedCallback; | 30 DistillationFinishedCallback; |
31 | 31 |
32 DistillerViewer(ios::ChromeBrowserState* browser_state, | 32 DistillerViewer(ios::ChromeBrowserState* browser_state, |
33 const GURL& url, | 33 const GURL& url, |
34 const DistillationFinishedCallback& callback); | 34 const DistillationFinishedCallback& callback); |
35 ~DistillerViewer() override; | 35 ~DistillerViewer() override; |
36 | 36 |
| 37 void OnArticleReady( |
| 38 const dom_distiller::DistilledArticleProto* article_proto) override; |
| 39 |
37 void SendJavaScript(const std::string& buffer) override; | 40 void SendJavaScript(const std::string& buffer) override; |
38 | 41 |
39 std::string GetJavaScriptBuffer(); | |
40 | |
41 private: | 42 private: |
42 // The url of the distilled page. | 43 // The url of the distilled page. |
43 const GURL url_; | 44 const GURL url_; |
44 // Interface for accessing preferences for distilled pages. | |
45 scoped_ptr<DistilledPagePrefs> distilled_page_prefs_; | |
46 // JavaScript buffer. | 45 // JavaScript buffer. |
47 std::string js_buffer_; | 46 std::string js_buffer_; |
| 47 // Callback to run once distillation is complete. |
| 48 const DistillationFinishedCallback callback_; |
48 | 49 |
49 DISALLOW_COPY_AND_ASSIGN(DistillerViewer); | 50 DISALLOW_COPY_AND_ASSIGN(DistillerViewer); |
50 }; | 51 }; |
51 | 52 |
52 } // namespace dom_distiller | 53 } // namespace dom_distiller |
53 | 54 |
54 #endif // IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ | 55 #endif // IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_ |
OLD | NEW |