| 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/prerendering_offliner.h" | 5 #include "chrome/browser/android/offline_pages/prerendering_offliner.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" | 10 #include "chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 THIRD_PARTY_COOKIES_DISABLED, | 39 THIRD_PARTY_COOKIES_DISABLED, |
| 40 NETWORK_PREDICTION_DISABLED, | 40 NETWORK_PREDICTION_DISABLED, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 namespace offline_pages { | 45 namespace offline_pages { |
| 46 | 46 |
| 47 PrerenderingOffliner::PrerenderingOffliner( | 47 PrerenderingOffliner::PrerenderingOffliner( |
| 48 content::BrowserContext* browser_context, | 48 content::BrowserContext* browser_context, |
| 49 const OfflinerPolicy* policy, | |
| 50 OfflinePageModel* offline_page_model) | 49 OfflinePageModel* offline_page_model) |
| 51 : browser_context_(browser_context), | 50 : browser_context_(browser_context), |
| 52 offline_page_model_(offline_page_model), | 51 offline_page_model_(offline_page_model), |
| 53 pending_request_(nullptr), | 52 pending_request_(nullptr), |
| 54 is_low_end_device_(base::SysInfo::IsLowEndDevice()), | 53 is_low_end_device_(base::SysInfo::IsLowEndDevice()), |
| 55 app_listener_(nullptr), | 54 app_listener_(nullptr), |
| 56 weak_ptr_factory_(this) {} | 55 weak_ptr_factory_(this) {} |
| 57 | 56 |
| 58 PrerenderingOffliner::~PrerenderingOffliner() {} | 57 PrerenderingOffliner::~PrerenderingOffliner() {} |
| 59 | 58 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { | 262 base::android::APPLICATION_STATE_HAS_RUNNING_ACTIVITIES) { |
| 264 DVLOG(1) << "App became active, canceling current offlining request"; | 263 DVLOG(1) << "App became active, canceling current offlining request"; |
| 265 SavePageRequest* request = pending_request_.get(); | 264 SavePageRequest* request = pending_request_.get(); |
| 266 Cancel(); | 265 Cancel(); |
| 267 completion_callback_.Run(*request, | 266 completion_callback_.Run(*request, |
| 268 Offliner::RequestStatus::FOREGROUND_CANCELED); | 267 Offliner::RequestStatus::FOREGROUND_CANCELED); |
| 269 } | 268 } |
| 270 } | 269 } |
| 271 | 270 |
| 272 } // namespace offline_pages | 271 } // namespace offline_pages |
| OLD | NEW |