OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h
" |
| 6 |
| 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "chrome/common/chrome_constants.h" |
| 11 #include "components/offline_pages/offline_page_model.h" |
| 12 #include "components/offline_pages/offline_page_test_store.h" |
| 13 #include "content/public/browser/browser_context.h" |
| 14 |
| 15 namespace offline_pages { |
| 16 |
| 17 scoped_ptr<KeyedService> BuildTestOfflinePageModel( |
| 18 content::BrowserContext* context) { |
| 19 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
| 20 base::ThreadTaskRunnerHandle::Get(); |
| 21 |
| 22 scoped_ptr<OfflinePageTestStore> metadata_store( |
| 23 new OfflinePageTestStore(task_runner)); |
| 24 |
| 25 base::FilePath archives_dir = |
| 26 context->GetPath().Append(chrome::kOfflinePageArchviesDirname); |
| 27 |
| 28 return scoped_ptr<KeyedService>( |
| 29 new OfflinePageModel(metadata_store.Pass(), archives_dir, task_runner)); |
| 30 } |
| 31 |
| 32 } // namespace offline_pages |
OLD | NEW |