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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_
6 #define IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "components/dom_distiller/core/dom_distiller_request_view_base.h"
12 #include "components/dom_distiller/core/task_tracker.h"
17 class ChromeBrowserState
;
20 namespace dom_distiller
{
22 class DistilledPagePrefs
;
24 // A very simple and naive implementation of the dom_distiller
25 // ViewRequestDelegate: From an URL it builds an HTML string and notifies when
27 class DistillerViewer
: public DomDistillerRequestViewBase
{
29 typedef base::Callback
<void(const GURL
&, const std::string
&)>
30 DistillationFinishedCallback
;
32 DistillerViewer(ios::ChromeBrowserState
* browser_state
,
34 const DistillationFinishedCallback
& callback
);
35 ~DistillerViewer() override
;
38 const dom_distiller::DistilledArticleProto
* article_proto
) override
;
40 void SendJavaScript(const std::string
& buffer
) override
;
43 // The url of the distilled page.
46 std::string js_buffer_
;
47 // Callback to run once distillation is complete.
48 const DistillationFinishedCallback callback_
;
50 DISALLOW_COPY_AND_ASSIGN(DistillerViewer
);
53 } // namespace dom_distiller
55 #endif // IOS_CHROME_BROWSER_DOM_DISTILLER_DISTILLER_VIEWER_H_