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

Unified Diff: chrome/browser/dom_distiller/dom_distiller_service_factory.cc

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
« no previous file with comments | « no previous file | chrome/chrome_browser.gypi » ('j') | components/dom_distiller/core/distiller_page.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_distiller/dom_distiller_service_factory.cc
diff --git a/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
index 9c4ea3e41c3963caae5bbc4e65fa5b75fe6a2856..f6505375e468cd77384fb394534b73ec7548f07b 100644
--- a/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
+++ b/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -16,6 +16,8 @@
#include "components/leveldb_proto/proto_database_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
+#include "grit/components_resources.h"
+#include "ui/base/resource/resource_bundle.h"
namespace dom_distiller {
@@ -66,8 +68,12 @@ KeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor(
scoped_ptr<DomDistillerStore> dom_distiller_store(
new DomDistillerStore(db.Pass(), database_dir));
+ const std::string distiller_js_script =
+ ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_DISTILLER_JS)
+ .as_string();
scoped_ptr<DistillerPageFactory> distiller_page_factory(
- new DistillerPageWebContentsFactory(profile));
+ new DistillerPageWebContentsFactory(profile, distiller_js_script));
scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
new DistillerURLFetcherFactory(profile->GetRequestContext()));
« no previous file with comments | « no previous file | chrome/chrome_browser.gypi » ('j') | components/dom_distiller/core/distiller_page.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698