| 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, | |
| 19 OfflinePageModel* offline_page_model) | 18 OfflinePageModel* offline_page_model) |
| 20 : browser_context_(browser_context), | 19 : browser_context_(browser_context), |
| 21 offline_page_model_(offline_page_model), | 20 offline_page_model_(offline_page_model), |
| 22 is_low_end_device_(base::SysInfo::IsLowEndDevice()), | 21 is_low_end_device_(base::SysInfo::IsLowEndDevice()), |
| 23 save_state_(NONE), | 22 save_state_(NONE), |
| 24 weak_ptr_factory_(this) { | 23 weak_ptr_factory_(this) { |
| 25 DCHECK(offline_page_model_); | 24 DCHECK(offline_page_model_); |
| 26 DCHECK(browser_context_); | 25 DCHECK(browser_context_); |
| 27 } | 26 } |
| 28 | 27 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 application_state == | 167 application_state == |
| 169 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { | 168 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { |
| 170 DVLOG(1) << "App became active, canceling current offlining request"; | 169 DVLOG(1) << "App became active, canceling current offlining request"; |
| 171 SavePageRequest* request = pending_request_.get(); | 170 SavePageRequest* request = pending_request_.get(); |
| 172 Cancel(); | 171 Cancel(); |
| 173 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED); | 172 completion_callback_.Run(*request, RequestStatus::FOREGROUND_CANCELED); |
| 174 } | 173 } |
| 175 } | 174 } |
| 176 | 175 |
| 177 } // namespace offline_pages | 176 } // namespace offline_pages |
| OLD | NEW |