| 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 "chrome/browser/android/offline_pages/offline_page_model_factory.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_model_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/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 #include "base/sequenced_task_runner.h" | 11 #include "base/sequenced_task_runner.h" |
| 12 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/profiles/incognito_helpers.h" | 13 #include "chrome/browser/profiles/incognito_helpers.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 16 #include "components/offline_pages/offline_page_metadata_store_sql.h" | 17 #include "components/offline_pages/offline_page_metadata_store_sql.h" |
| 17 #include "components/offline_pages/offline_page_model.h" | 18 #include "components/offline_pages/offline_page_model.h" |
| 18 #include "components/offline_pages/proto/offline_pages.pb.h" | 19 #include "components/offline_pages/proto/offline_pages.pb.h" |
| 20 #include "components/rappor/rappor_service.h" |
| 19 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 20 | 22 |
| 21 namespace offline_pages { | 23 namespace offline_pages { |
| 22 | 24 |
| 23 OfflinePageModelFactory::OfflinePageModelFactory() | 25 OfflinePageModelFactory::OfflinePageModelFactory() |
| 24 : BrowserContextKeyedServiceFactory( | 26 : BrowserContextKeyedServiceFactory( |
| 25 "OfflinePageModel", | 27 "OfflinePageModel", |
| 26 BrowserContextDependencyManager::GetInstance()) { | 28 BrowserContextDependencyManager::GetInstance()) { |
| 27 } | 29 } |
| 28 | 30 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 | 49 |
| 48 base::FilePath store_path = | 50 base::FilePath store_path = |
| 49 profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); | 51 profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); |
| 50 std::unique_ptr<OfflinePageMetadataStore> metadata_store( | 52 std::unique_ptr<OfflinePageMetadataStore> metadata_store( |
| 51 new OfflinePageMetadataStoreSQL(background_task_runner, store_path)); | 53 new OfflinePageMetadataStoreSQL(background_task_runner, store_path)); |
| 52 | 54 |
| 53 base::FilePath archives_dir = | 55 base::FilePath archives_dir = |
| 54 profile->GetPath().Append(chrome::kOfflinePageArchviesDirname); | 56 profile->GetPath().Append(chrome::kOfflinePageArchviesDirname); |
| 55 | 57 |
| 56 return new OfflinePageModel(std::move(metadata_store), archives_dir, | 58 return new OfflinePageModel(std::move(metadata_store), archives_dir, |
| 59 g_browser_process->rappor_service()->AsWeakPtr(), |
| 57 background_task_runner); | 60 background_task_runner); |
| 58 } | 61 } |
| 59 | 62 |
| 60 } // namespace offline_pages | 63 } // namespace offline_pages |
| 61 | 64 |
| OLD | NEW |