| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 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/background_loader_offliner_factor
y.h" | |
| 6 | |
| 7 #include "chrome/browser/android/offline_pages/background_loader_offliner.h" | |
| 8 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" | |
| 9 | |
| 10 namespace offline_pages { | |
| 11 | |
| 12 class OfflinerPolicy; | |
| 13 | |
| 14 BackgroundLoaderOfflinerFactory::BackgroundLoaderOfflinerFactory( | |
| 15 content::BrowserContext* context) { | |
| 16 offliner_ = nullptr; | |
| 17 context_ = context; | |
| 18 } | |
| 19 | |
| 20 BackgroundLoaderOfflinerFactory::~BackgroundLoaderOfflinerFactory() { | |
| 21 delete offliner_; | |
| 22 } | |
| 23 | |
| 24 Offliner* BackgroundLoaderOfflinerFactory::GetOffliner( | |
| 25 const OfflinerPolicy* policy) { | |
| 26 if (offliner_ == nullptr) { | |
| 27 OfflinePageModel* model = | |
| 28 OfflinePageModelFactory::GetInstance()->GetForBrowserContext(context_); | |
| 29 | |
| 30 offliner_ = new BackgroundLoaderOffliner(context_, policy, model); | |
| 31 } | |
| 32 | |
| 33 return offliner_; | |
| 34 } | |
| 35 | |
| 36 } // namespace offline_pages | |
| OLD | NEW |