| 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> |
| 8 |
| 7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 8 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 9 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 10 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 11 #include "chrome/browser/profiles/incognito_helpers.h" | 13 #include "chrome/browser/profiles/incognito_helpers.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 16 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 15 #include "components/offline_pages/offline_page_metadata_store_impl.h" | 17 #include "components/offline_pages/offline_page_metadata_store_impl.h" |
| 16 #include "components/offline_pages/offline_page_model.h" | 18 #include "components/offline_pages/offline_page_model.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 45 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | 47 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); |
| 46 | 48 |
| 47 base::FilePath store_path = | 49 base::FilePath store_path = |
| 48 profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); | 50 profile->GetPath().Append(chrome::kOfflinePageMetadataDirname); |
| 49 scoped_ptr<OfflinePageMetadataStoreImpl> metadata_store( | 51 scoped_ptr<OfflinePageMetadataStoreImpl> metadata_store( |
| 50 new OfflinePageMetadataStoreImpl(background_task_runner, store_path)); | 52 new OfflinePageMetadataStoreImpl(background_task_runner, store_path)); |
| 51 | 53 |
| 52 base::FilePath archives_dir = | 54 base::FilePath archives_dir = |
| 53 profile->GetPath().Append(chrome::kOfflinePageArchviesDirname); | 55 profile->GetPath().Append(chrome::kOfflinePageArchviesDirname); |
| 54 | 56 |
| 55 return new OfflinePageModel(metadata_store.Pass(), archives_dir, | 57 return new OfflinePageModel(std::move(metadata_store), archives_dir, |
| 56 background_task_runner); | 58 background_task_runner); |
| 57 } | 59 } |
| 58 | 60 |
| 59 content::BrowserContext* OfflinePageModelFactory::GetBrowserContextToUse( | 61 content::BrowserContext* OfflinePageModelFactory::GetBrowserContextToUse( |
| 60 content::BrowserContext* context) const { | 62 content::BrowserContext* context) const { |
| 61 return chrome::GetBrowserContextRedirectedInIncognito(context); | 63 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 62 } | 64 } |
| 63 | 65 |
| 64 } // namespace offline_pages | 66 } // namespace offline_pages |
| 65 | 67 |
| OLD | NEW |