| 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" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "components/dom_distiller/core/article_entry.h" | 13 #include "components/dom_distiller/core/article_entry.h" |
| 14 #include "components/dom_distiller/core/distiller.h" | 14 #include "components/dom_distiller/core/distiller.h" |
| 15 #include "components/dom_distiller/core/dom_distiller_service.h" | 15 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 16 #include "components/dom_distiller/core/dom_distiller_store.h" | 16 #include "components/dom_distiller/core/dom_distiller_store.h" |
| 17 #include "components/dom_distiller/ios/distiller_page_factory_ios.h" | 17 #include "components/dom_distiller/ios/distiller_page_factory_ios.h" |
| 18 #include "components/keyed_service/core/keyed_service.h" | 18 #include "components/keyed_service/core/keyed_service.h" |
| 19 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 19 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 20 #include "components/leveldb_proto/proto_database.h" | 20 #include "components/leveldb_proto/proto_database.h" |
| 21 #include "components/leveldb_proto/proto_database_impl.h" | 21 #include "components/leveldb_proto/proto_database_impl.h" |
| 22 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" | 22 #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" |
| 23 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | 23 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 24 #include "ios/web/public/browser_state.h" | 24 #include "ios/web/public/browser_state.h" |
| 25 #include "ios/web/public/web_thread.h" | 25 #include "ios/web/public/web_thread.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 // A simple wrapper for DomDistillerService to expose it as a | 28 // A simple wrapper for DomDistillerService to expose it as a |
| 29 // KeyedService. | 29 // KeyedService. |
| 30 class DomDistillerKeyedService | 30 class DomDistillerKeyedService |
| 31 : public KeyedService, | 31 : public KeyedService, |
| 32 public dom_distiller::DomDistillerService { | 32 public dom_distiller::DomDistillerService { |
| 33 public: | 33 public: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 std::move(distiller_page_factory), std::move(distilled_page_prefs))); | 103 std::move(distiller_page_factory), std::move(distilled_page_prefs))); |
| 104 } | 104 } |
| 105 | 105 |
| 106 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse( | 106 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse( |
| 107 web::BrowserState* context) const { | 107 web::BrowserState* context) const { |
| 108 // Makes normal profile and off-the-record profile use same service instance. | 108 // Makes normal profile and off-the-record profile use same service instance. |
| 109 return GetBrowserStateRedirectedInIncognito(context); | 109 return GetBrowserStateRedirectedInIncognito(context); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace dom_distiller | 112 } // namespace dom_distiller |
| OLD | NEW |