| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 5 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( | 95 std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory( |
| 96 new DistillerURLFetcherFactory(context->GetRequestContext())); | 96 new DistillerURLFetcherFactory(context->GetRequestContext())); |
| 97 | 97 |
| 98 dom_distiller::proto::DomDistillerOptions options; | 98 dom_distiller::proto::DomDistillerOptions options; |
| 99 std::unique_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl( | 99 std::unique_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl( |
| 100 std::move(distiller_url_fetcher_factory), options)); | 100 std::move(distiller_url_fetcher_factory), options)); |
| 101 std::unique_ptr<DistilledPagePrefs> distilled_page_prefs( | 101 std::unique_ptr<DistilledPagePrefs> distilled_page_prefs( |
| 102 new DistilledPagePrefs( | 102 new DistilledPagePrefs( |
| 103 ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs())); | 103 ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs())); |
| 104 | 104 |
| 105 return base::WrapUnique(new DomDistillerKeyedService( | 105 return base::MakeUnique<DomDistillerKeyedService>( |
| 106 std::move(dom_distiller_store), std::move(distiller_factory), | 106 std::move(dom_distiller_store), std::move(distiller_factory), |
| 107 std::move(distiller_page_factory), std::move(distilled_page_prefs))); | 107 std::move(distiller_page_factory), std::move(distilled_page_prefs)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse( | 110 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse( |
| 111 web::BrowserState* context) const { | 111 web::BrowserState* context) const { |
| 112 // Makes normal profile and off-the-record profile use same service instance. | 112 // Makes normal profile and off-the-record profile use same service instance. |
| 113 return GetBrowserStateRedirectedInIncognito(context); | 113 return GetBrowserStateRedirectedInIncognito(context); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace dom_distiller | 116 } // namespace dom_distiller |
| OLD | NEW |