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