Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / chrome / browser / dom_distiller / distiller_viewer.h
blob1cb4f843001325a9e871f33e36eca6e634b206a6
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_
8 #include <string>
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"
14 class GURL;
16 namespace ios {
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
26 // finished.
27 class DistillerViewer : public DomDistillerRequestViewBase {
28 public:
29 typedef base::Callback<void(const GURL&, const std::string&)>
30 DistillationFinishedCallback;
32 DistillerViewer(ios::ChromeBrowserState* browser_state,
33 const GURL& url,
34 const DistillationFinishedCallback& callback);
35 ~DistillerViewer() override;
37 void OnArticleReady(
38 const dom_distiller::DistilledArticleProto* article_proto) override;
40 void SendJavaScript(const std::string& buffer) override;
42 private:
43 // The url of the distilled page.
44 const GURL url_;
45 // JavaScript buffer.
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_