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 "components/dom_distiller/core/dom_distiller_service.h" | 5 #include "components/dom_distiller/core/dom_distiller_service.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "components/dom_distiller/core/distilled_content_store.h" | 9 #include "components/dom_distiller/core/distilled_content_store.h" |
10 #include "components/dom_distiller/core/dom_distiller_store.h" | 10 #include "components/dom_distiller/core/dom_distiller_store.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
32 const DistilledArticleProto* article_proto, | 32 const DistilledArticleProto* article_proto, |
33 bool distillation_succeeded) { | 33 bool distillation_succeeded) { |
34 article_cb.Run(distillation_succeeded); | 34 article_cb.Run(distillation_succeeded); |
35 } | 35 } |
36 | 36 |
37 } // namespace | 37 } // namespace |
38 | 38 |
39 DomDistillerService::DomDistillerService( | 39 DomDistillerService::DomDistillerService( |
40 scoped_ptr<DomDistillerStoreInterface> store, | 40 scoped_ptr<DomDistillerStoreInterface> store, |
41 scoped_ptr<DistillerFactory> distiller_factory, | 41 scoped_ptr<DistillerFactory> distiller_factory, |
42 scoped_ptr<DistillerPageFactory> distiller_page_factory) | 42 scoped_ptr<DistillerPageFactory> distiller_page_factory, |
43 scoped_ptr<ReaderModePrefs> reader_mode_prefs) | |
43 : store_(store.Pass()), | 44 : store_(store.Pass()), |
44 content_store_(new InMemoryContentStore(kDefaultMaxNumCachedEntries)), | 45 content_store_(new InMemoryContentStore(kDefaultMaxNumCachedEntries)), |
45 distiller_factory_(distiller_factory.Pass()), | 46 distiller_factory_(distiller_factory.Pass()), |
46 distiller_page_factory_(distiller_page_factory.Pass()) { | 47 distiller_page_factory_(distiller_page_factory.Pass()), |
48 reader_mode_prefs_(reader_mode_prefs.Pass()) { | |
47 } | 49 } |
48 | 50 |
49 DomDistillerService::~DomDistillerService() { | 51 DomDistillerService::~DomDistillerService() { |
50 } | 52 } |
51 | 53 |
52 syncer::SyncableService* DomDistillerService::GetSyncableService() const { | 54 syncer::SyncableService* DomDistillerService::GetSyncableService() const { |
53 return store_->GetSyncableService(); | 55 return store_->GetSyncableService(); |
54 } | 56 } |
55 | 57 |
56 scoped_ptr<DistillerPage> DomDistillerService::CreateDefaultDistillerPage() { | 58 scoped_ptr<DistillerPage> DomDistillerService::CreateDefaultDistillerPage() { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 void DomDistillerService::AddObserver(DomDistillerObserver* observer) { | 234 void DomDistillerService::AddObserver(DomDistillerObserver* observer) { |
233 DCHECK(observer); | 235 DCHECK(observer); |
234 store_->AddObserver(observer); | 236 store_->AddObserver(observer); |
235 } | 237 } |
236 | 238 |
237 void DomDistillerService::RemoveObserver(DomDistillerObserver* observer) { | 239 void DomDistillerService::RemoveObserver(DomDistillerObserver* observer) { |
238 DCHECK(observer); | 240 DCHECK(observer); |
239 store_->RemoveObserver(observer); | 241 store_->RemoveObserver(observer); |
240 } | 242 } |
241 | 243 |
244 ReaderModePrefs* DomDistillerService::GetReaderModePrefs() const { | |
245 return reader_mode_prefs_.get(); | |
246 } | |
nyquist
2014/06/23 16:03:06
Nit: newline after this.
smaslo
2014/06/23 22:14:33
Done.
| |
242 } // namespace dom_distiller | 247 } // namespace dom_distiller |
OLD | NEW |