Index: chrome/browser/android/offline_pages/background_loader_offliner_factory.cc |
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner_factory.cc b/chrome/browser/android/offline_pages/background_loader_offliner_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..839aaa7ef9d23fc4483fa5ba9fba07a6ed7d7511 |
--- /dev/null |
+++ b/chrome/browser/android/offline_pages/background_loader_offliner_factory.cc |
@@ -0,0 +1,36 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/android/offline_pages/background_loader_offliner_factory.h" |
+ |
+#include "chrome/browser/android/offline_pages/background_loader_offliner.h" |
+#include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
+ |
+namespace offline_pages { |
+ |
+class OfflinerPolicy; |
+ |
+BackgroundLoaderOfflinerFactory::BackgroundLoaderOfflinerFactory( |
+ content::BrowserContext* context) { |
+ offliner_ = nullptr; |
+ context_ = context; |
+} |
+ |
+BackgroundLoaderOfflinerFactory::~BackgroundLoaderOfflinerFactory() { |
+ delete offliner_; |
+} |
+ |
+Offliner* BackgroundLoaderOfflinerFactory::GetOffliner( |
Pete Williamson
2016/12/17 01:26:26
A test for this method would be good. (It's OK to
chili
2016/12/21 18:01:48
Per discussion, I may be removing the factory alto
|
+ const OfflinerPolicy* policy) { |
+ if (offliner_ == nullptr) { |
+ OfflinePageModel* model = |
+ OfflinePageModelFactory::GetInstance()->GetForBrowserContext(context_); |
+ |
+ offliner_ = new BackgroundLoaderOffliner(context_, policy, model); |
+ } |
+ |
+ return offliner_; |
+} |
+ |
+} // namespace offline_pages |