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

Unified Diff: components/dom_distiller/standalone/content_extractor.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
Index: components/dom_distiller/standalone/content_extractor.cc
diff --git a/components/dom_distiller/standalone/content_extractor.cc b/components/dom_distiller/standalone/content_extractor.cc
index 760b1658890370b6331ba432544121559d786828..dd694959a9cb9bb570278b7642ee9449f16143b3 100644
--- a/components/dom_distiller/standalone/content_extractor.cc
+++ b/components/dom_distiller/standalone/content_extractor.cc
@@ -22,6 +22,7 @@
#include "content/public/test/content_browser_test.h"
#include "content/shell/browser/shell.h"
#include "net/dns/mock_host_resolver.h"
+#include "third_party/dom_distiller_js/dom_distiller.pb.h"
#include "ui/base/resource/resource_bundle.h"
using content::ContentBrowserTest;
@@ -43,6 +44,8 @@ const char* kOutputFile = "output-file";
// output.
const char* kShouldOutputBinary = "output-binary";
+const char* kExtractTextOnly = "extract-text-only";
+
scoped_ptr<DomDistillerService> CreateDomDistillerService(
content::BrowserContext* context,
const base::FilePath& db_path) {
@@ -61,8 +64,13 @@ scoped_ptr<DomDistillerService> CreateDomDistillerService(
new DistillerPageWebContentsFactory(context));
scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
new DistillerURLFetcherFactory(context->GetRequestContext()));
+
+ dom_distiller::proto::DomDistillerOptions options;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(kExtractTextOnly)) {
+ options.set_extract_text_only(true);
+ }
scoped_ptr<DistillerFactory> distiller_factory(
- new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass()));
+ new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options));
return scoped_ptr<DomDistillerService>(new DomDistillerService(
dom_distiller_store.PassAs<DomDistillerStoreInterface>(),
« no previous file with comments | « components/dom_distiller/core/distiller_unittest.cc ('k') | third_party/dom_distiller_js/dom_distiller_js.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698