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

Unified Diff: ios/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
Index: ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
index 0adbfa783f93f7b95517458dfd5e49621210be42..8b88d6f38dd557ca20402fe1cd8552d2a12981f5 100644
--- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
+++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -17,10 +17,12 @@
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/leveldb_proto/proto_database.h"
#include "components/leveldb_proto/proto_database_impl.h"
+#include "grit/components_resources.h"
#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/web/public/browser_state.h"
#include "ios/web/public/web_thread.h"
+#include "ui/base/resource/resource_bundle.h"
namespace {
// A simple wrapper for DomDistillerService to expose it as a
@@ -85,8 +87,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 DistillerPageFactoryIOS(browser_state));
+ new DistillerPageFactoryIOS(browser_state, distiller_js_script));
scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
new DistillerURLFetcherFactory(browser_state->GetRequestContext()));

Powered by Google App Engine
This is Rietveld 408576698