Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 14 #include "components/dom_distiller/content/distiller_page_web_contents.h" | 14 #include "components/dom_distiller/content/distiller_page_web_contents.h" |
| 15 #include "components/dom_distiller/core/article_entry.h" | 15 #include "components/dom_distiller/core/article_entry.h" |
| 16 #include "components/dom_distiller/core/distilled_page_prefs.h" | |
| 16 #include "components/dom_distiller/core/distiller.h" | 17 #include "components/dom_distiller/core/distiller.h" |
| 17 #include "components/dom_distiller/core/dom_distiller_service.h" | 18 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 18 #include "components/dom_distiller/core/dom_distiller_store.h" | 19 #include "components/dom_distiller/core/dom_distiller_store.h" |
| 19 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 20 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 20 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | 21 #include "components/dom_distiller/core/proto/distilled_page.pb.h" |
| 21 #include "components/dom_distiller/core/task_tracker.h" | 22 #include "components/dom_distiller/core/task_tracker.h" |
| 22 #include "components/leveldb_proto/proto_database.h" | 23 #include "components/leveldb_proto/proto_database.h" |
| 23 #include "components/leveldb_proto/proto_database_impl.h" | 24 #include "components/leveldb_proto/proto_database_impl.h" |
| 24 #include "content/public/browser/browser_context.h" | 25 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 kDebugLevel), | 94 kDebugLevel), |
| 94 &debug_level)) { | 95 &debug_level)) { |
| 95 options.set_debug_level(debug_level); | 96 options.set_debug_level(debug_level); |
| 96 } | 97 } |
| 97 scoped_ptr<DistillerFactory> distiller_factory( | 98 scoped_ptr<DistillerFactory> distiller_factory( |
| 98 new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options)); | 99 new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options)); |
| 99 | 100 |
| 100 return scoped_ptr<DomDistillerService>(new DomDistillerService( | 101 return scoped_ptr<DomDistillerService>(new DomDistillerService( |
| 101 dom_distiller_store.PassAs<DomDistillerStoreInterface>(), | 102 dom_distiller_store.PassAs<DomDistillerStoreInterface>(), |
| 102 distiller_factory.Pass(), | 103 distiller_factory.Pass(), |
| 103 distiller_page_factory.Pass())); | 104 distiller_page_factory.Pass(), |
| 105 scoped_ptr<DistilledPagePrefs>())); | |
|
nyquist
2014/07/11 01:41:05
I think this needs a preference. The content extra
smaslo
2014/07/11 22:37:44
Done.
| |
| 104 } | 106 } |
| 105 | 107 |
| 106 void AddComponentsResources() { | 108 void AddComponentsResources() { |
| 107 base::FilePath pak_file; | 109 base::FilePath pak_file; |
| 108 base::FilePath pak_dir; | 110 base::FilePath pak_dir; |
| 109 PathService::Get(base::DIR_MODULE, &pak_dir); | 111 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 110 pak_file = pak_dir.Append(FILE_PATH_LITERAL("components_resources.pak")); | 112 pak_file = pak_dir.Append(FILE_PATH_LITERAL("components_resources.pak")); |
| 111 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 113 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 112 pak_file, ui::SCALE_FACTOR_NONE); | 114 pak_file, ui::SCALE_FACTOR_NONE); |
| 113 } | 115 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 std::string output_data_; | 318 std::string output_data_; |
| 317 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; | 319 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; |
| 318 }; | 320 }; |
| 319 | 321 |
| 320 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { | 322 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { |
| 321 Start(); | 323 Start(); |
| 322 base::RunLoop().Run(); | 324 base::RunLoop().Run(); |
| 323 } | 325 } |
| 324 | 326 |
| 325 } // namespace dom_distiller | 327 } // namespace dom_distiller |
| OLD | NEW |