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

Unified Diff: components/dom_distiller/core/distiller.cc

Issue 286583002: Pull DomDistillerOptions up to the DistillerFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: :/ Created 6 years, 7 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
« no previous file with comments | « components/dom_distiller/core/distiller.h ('k') | components/dom_distiller/core/distiller_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/distiller.cc
diff --git a/components/dom_distiller/core/distiller.cc b/components/dom_distiller/core/distiller.cc
index 070e6818d9139095afce639d9be775e473e1ff44..472b45361881b29c2f25b66210d88d058de50f6c 100644
--- a/components/dom_distiller/core/distiller.cc
+++ b/components/dom_distiller/core/distiller.cc
@@ -29,15 +29,17 @@ const size_t kMaxPagesInArticle = 32;
namespace dom_distiller {
DistillerFactoryImpl::DistillerFactoryImpl(
- scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory)
- : distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()) {
+ scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory,
+ const dom_distiller::proto::DomDistillerOptions& dom_distiller_options)
+ : distiller_url_fetcher_factory_(distiller_url_fetcher_factory.Pass()),
+ dom_distiller_options_(dom_distiller_options) {
}
DistillerFactoryImpl::~DistillerFactoryImpl() {}
scoped_ptr<Distiller> DistillerFactoryImpl::CreateDistiller() {
- scoped_ptr<DistillerImpl> distiller(
- new DistillerImpl(*distiller_url_fetcher_factory_));
+ scoped_ptr<DistillerImpl> distiller(new DistillerImpl(
+ *distiller_url_fetcher_factory_, dom_distiller_options_));
return distiller.PassAs<Distiller>();
}
@@ -46,8 +48,10 @@ DistillerImpl::DistilledPageData::DistilledPageData() {}
DistillerImpl::DistilledPageData::~DistilledPageData() {}
DistillerImpl::DistillerImpl(
- const DistillerURLFetcherFactory& distiller_url_fetcher_factory)
+ const DistillerURLFetcherFactory& distiller_url_fetcher_factory,
+ const dom_distiller::proto::DomDistillerOptions& dom_distiller_options)
: distiller_url_fetcher_factory_(distiller_url_fetcher_factory),
+ dom_distiller_options_(dom_distiller_options),
max_pages_in_article_(kMaxPagesInArticle),
destruction_allowed_(true),
weak_factory_(this) {
@@ -120,6 +124,7 @@ void DistillerImpl::DistillNextPage() {
started_pages_index_[page_num] = pages_.size() - 1;
distiller_page_->DistillPage(
url,
+ dom_distiller_options_,
base::Bind(&DistillerImpl::OnPageDistillationFinished,
weak_factory_.GetWeakPtr(),
page_num,
« no previous file with comments | « components/dom_distiller/core/distiller.h ('k') | components/dom_distiller/core/distiller_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698