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

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

Issue 134873008: Add support for displaying distilled articles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverting change to scoped_ptr Created 6 years, 11 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/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc » ('j') | no next file with comments »
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 4d248d238d7133a866323384f7cb82f9e0b96fe7..679e9141a4a5dd59c65ef47702964202291b5a57 100644
--- a/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
+++ b/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -44,12 +44,9 @@ DomDistillerServiceFactory::~DomDistillerServiceFactory() {}
BrowserContextKeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
- content::URLDataSource::Add(
- profile, new DomDistillerViewerSource(chrome::kDomDistillerScheme));
-
scoped_refptr<base::SequencedTaskRunner> background_task_runner =
- content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
- content::BrowserThread::GetBlockingPool()->GetSequenceToken());
+ content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
+ content::BrowserThread::GetBlockingPool()->GetSequenceToken());
scoped_ptr<DomDistillerDatabase> db(
new DomDistillerDatabase(background_task_runner));
@@ -57,21 +54,27 @@ BrowserContextKeyedService* DomDistillerServiceFactory::BuildServiceInstanceFor(
base::FilePath database_dir(
profile->GetPath().Append(FILE_PATH_LITERAL("Articles")));
- scoped_ptr<DomDistillerStore> dom_distiller_store(
- new DomDistillerStore(db.PassAs<DomDistillerDatabaseInterface>(),
- database_dir));
+ scoped_ptr<DomDistillerStore> dom_distiller_store(new DomDistillerStore(
+ db.PassAs<DomDistillerDatabaseInterface>(), database_dir));
scoped_ptr<DistillerPageFactory> distiller_page_factory(
new DistillerPageWebContentsFactory(profile));
scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
new DistillerURLFetcherFactory(profile->GetRequestContext()));
- scoped_ptr<DistillerFactory> distiller_factory(
- new DistillerFactoryImpl(distiller_page_factory.Pass(),
- distiller_url_fetcher_factory.Pass()));
- return new DomDistillerContextKeyedService(
- dom_distiller_store.PassAs<DomDistillerStoreInterface>(),
- distiller_factory.Pass());
+ scoped_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl(
+ distiller_page_factory.Pass(), distiller_url_fetcher_factory.Pass()));
+
+ DomDistillerContextKeyedService* service =
+ new DomDistillerContextKeyedService(
+ dom_distiller_store.PassAs<DomDistillerStoreInterface>(),
+ distiller_factory.Pass());
+
+ // Set up URL data source for the chrome-distiller:// scheme.
+ content::URLDataSource::Add(
+ profile,
+ new DomDistillerViewerSource(service, chrome::kDomDistillerScheme));
+ return service;
}
content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse(
« no previous file with comments | « no previous file | chrome/browser/dom_distiller/dom_distiller_viewer_source_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698