OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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/background_loader_offliner.h" | 5 #include "chrome/browser/android/offline_pages/background_loader_offliner.h" |
6 | 6 |
7 #include "base/sys_info.h" | 7 #include "base/sys_info.h" |
8 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 8 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
9 #include "components/offline_pages/core/background/save_page_request.h" | 9 #include "components/offline_pages/core/background/save_page_request.h" |
10 #include "components/offline_pages/core/offline_page_model.h" | 10 #include "components/offline_pages/core/offline_page_model.h" |
11 #include "content/public/browser/browser_context.h" | 11 #include "content/public/browser/browser_context.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 | 13 |
14 namespace offline_pages { | 14 namespace offline_pages { |
15 | 15 |
16 BackgroundLoaderOffliner::BackgroundLoaderOffliner( | 16 BackgroundLoaderOffliner::BackgroundLoaderOffliner( |
17 content::BrowserContext* browser_context, | 17 content::BrowserContext* browser_context, |
| 18 const OfflinerPolicy* policy, |
18 OfflinePageModel* offline_page_model) | 19 OfflinePageModel* offline_page_model) |
19 : browser_context_(browser_context), | 20 : browser_context_(browser_context), |
20 offline_page_model_(offline_page_model), | 21 offline_page_model_(offline_page_model), |
21 is_low_end_device_(base::SysInfo::IsLowEndDevice()), | 22 is_low_end_device_(base::SysInfo::IsLowEndDevice()), |
22 save_state_(NONE), | 23 save_state_(NONE), |
23 weak_ptr_factory_(this) { | 24 weak_ptr_factory_(this) { |
24 DCHECK(offline_page_model_); | 25 DCHECK(offline_page_model_); |
25 DCHECK(browser_context_); | 26 DCHECK(browser_context_); |
26 } | 27 } |
27 | 28 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 application_state == | 168 application_state == |
168 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { | 169 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { |
169 DVLOG(1) << "App became active, canceling current offlining request"; | 170 DVLOG(1) << "App became active, canceling current offlining request"; |
170 SavePageRequest* request = pending_request_.get(); | 171 SavePageRequest* request = pending_request_.get(); |
171 Cancel(); | 172 Cancel(); |
172 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED); | 173 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED); |
173 } | 174 } |
174 } | 175 } |
175 | 176 |
176 } // namespace offline_pages | 177 } // namespace offline_pages |
OLD | NEW |