Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Unified Diff: components/dom_distiller/content/distiller_page_web_contents.h

Issue 901793002: Add support for providing an external file for extracting content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved injection to constructor Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/content/distiller_page_web_contents.h
diff --git a/components/dom_distiller/content/distiller_page_web_contents.h b/components/dom_distiller/content/distiller_page_web_contents.h
index e73b0ccc9b04e5780664768f3189e76507e171b6..c4dc9f421a3d37b63dbcaca7cf0b7dfe5ff6105c 100644
--- a/components/dom_distiller/content/distiller_page_web_contents.h
+++ b/components/dom_distiller/content/distiller_page_web_contents.h
@@ -31,9 +31,8 @@ class SourcePageHandleWebContents : public SourcePageHandle {
class DistillerPageWebContentsFactory : public DistillerPageFactory {
public:
- explicit DistillerPageWebContentsFactory(
- content::BrowserContext* browser_context)
- : DistillerPageFactory(), browser_context_(browser_context) {}
+ DistillerPageWebContentsFactory(content::BrowserContext* browser_context,
+ const std::string& distiller_js_script);
~DistillerPageWebContentsFactory() override {}
scoped_ptr<DistillerPage> CreateDistillerPage(
@@ -43,6 +42,11 @@ class DistillerPageWebContentsFactory : public DistillerPageFactory {
private:
content::BrowserContext* browser_context_;
+ // Contains the script which will be passed on when constructing the
+ // DistillerPageWebContents. It should contain the string $$OPTIONS, which
+ // will be replaced with options passed in as proto::DomDistillerOptions
+ // before it is executed in the page context.
+ std::string distiller_js_script_;
};
class DistillerPageWebContents : public DistillerPage,
@@ -52,6 +56,7 @@ class DistillerPageWebContents : public DistillerPage,
DistillerPageWebContents(
content::BrowserContext* browser_context,
const gfx::Size& render_view_size,
+ const std::string& distiller_js_script,
scoped_ptr<SourcePageHandleWebContents> optional_web_contents_handle);
~DistillerPageWebContents() override;

Powered by Google App Engine
This is Rietveld 408576698