| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 5 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 6 | 6 |
| 7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
| 8 #include "components/dom_distiller/content/distiller_page_web_contents.h" | 8 #include "components/dom_distiller/content/distiller_page_web_contents.h" |
| 9 #include "components/dom_distiller/core/distiller.h" | 9 #include "components/dom_distiller/core/distiller.h" |
| 10 #include "components/dom_distiller/core/dom_distiller_store.h" | 10 #include "components/dom_distiller/core/dom_distiller_store.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 base::FilePath database_dir( | 55 base::FilePath database_dir( |
| 56 profile->GetPath().Append(FILE_PATH_LITERAL("Articles"))); | 56 profile->GetPath().Append(FILE_PATH_LITERAL("Articles"))); |
| 57 | 57 |
| 58 scoped_ptr<DomDistillerStore> dom_distiller_store(new DomDistillerStore( | 58 scoped_ptr<DomDistillerStore> dom_distiller_store(new DomDistillerStore( |
| 59 db.PassAs<DomDistillerDatabaseInterface>(), database_dir)); | 59 db.PassAs<DomDistillerDatabaseInterface>(), database_dir)); |
| 60 | 60 |
| 61 scoped_ptr<DistillerPageFactory> distiller_page_factory( | 61 scoped_ptr<DistillerPageFactory> distiller_page_factory( |
| 62 new DistillerPageWebContentsFactory(profile)); | 62 new DistillerPageWebContentsFactory(profile)); |
| 63 scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( | 63 scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( |
| 64 new DistillerURLFetcherFactory(profile->GetRequestContext())); | 64 new DistillerURLFetcherFactory(profile->GetRequestContext())); |
| 65 |
| 66 dom_distiller::proto::DomDistillerOptions options; |
| 67 if (VLOG_IS_ON(1)) { |
| 68 options.set_debug_level( |
| 69 logging::GetVlogLevelHelper(FROM_HERE.file_name(), |
| 70 ::strlen(FROM_HERE.file_name()))); |
| 71 } |
| 65 scoped_ptr<DistillerFactory> distiller_factory( | 72 scoped_ptr<DistillerFactory> distiller_factory( |
| 66 new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), | 73 new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options)); |
| 67 dom_distiller::proto::DomDistillerOptions())); | |
| 68 | 74 |
| 69 DomDistillerContextKeyedService* service = | 75 DomDistillerContextKeyedService* service = |
| 70 new DomDistillerContextKeyedService( | 76 new DomDistillerContextKeyedService( |
| 71 dom_distiller_store.PassAs<DomDistillerStoreInterface>(), | 77 dom_distiller_store.PassAs<DomDistillerStoreInterface>(), |
| 72 distiller_factory.Pass(), | 78 distiller_factory.Pass(), |
| 73 distiller_page_factory.Pass()); | 79 distiller_page_factory.Pass()); |
| 74 | 80 |
| 75 return service; | 81 return service; |
| 76 } | 82 } |
| 77 | 83 |
| 78 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( | 84 content::BrowserContext* DomDistillerServiceFactory::GetBrowserContextToUse( |
| 79 content::BrowserContext* context) const { | 85 content::BrowserContext* context) const { |
| 80 // TODO(cjhopman): Do we want this to be | 86 // TODO(cjhopman): Do we want this to be |
| 81 // GetBrowserContextRedirectedInIncognito? | 87 // GetBrowserContextRedirectedInIncognito? |
| 82 return context; | 88 return context; |
| 83 } | 89 } |
| 84 | 90 |
| 85 } // namespace dom_distiller | 91 } // namespace dom_distiller |
| OLD | NEW |