| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/recent_tab_helper.h" | 5 #include "chrome/browser/android/offline_pages/recent_tab_helper.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 ReportSnapshotCompleted(snapshot_info); | 284 ReportSnapshotCompleted(snapshot_info); |
| 285 return; | 285 return; |
| 286 } | 286 } |
| 287 | 287 |
| 288 snapshot_info->expected_page_quality = | 288 snapshot_info->expected_page_quality = |
| 289 snapshot_controller_->current_page_quality(); | 289 snapshot_controller_->current_page_quality(); |
| 290 OfflinePageModel::SavePageParams save_page_params; | 290 OfflinePageModel::SavePageParams save_page_params; |
| 291 save_page_params.url = snapshot_url_; | 291 save_page_params.url = snapshot_url_; |
| 292 save_page_params.client_id = snapshot_info->client_id; | 292 save_page_params.client_id = snapshot_info->client_id; |
| 293 save_page_params.proposed_offline_id = snapshot_info->request_id; | 293 save_page_params.proposed_offline_id = snapshot_info->request_id; |
| 294 save_page_params.is_background = false; |
| 294 page_model_->SavePage( | 295 page_model_->SavePage( |
| 295 save_page_params, delegate_->CreatePageArchiver(web_contents()), | 296 save_page_params, delegate_->CreatePageArchiver(web_contents()), |
| 296 base::Bind(&RecentTabHelper::SavePageCallback, | 297 base::Bind(&RecentTabHelper::SavePageCallback, |
| 297 weak_ptr_factory_.GetWeakPtr(), snapshot_info)); | 298 weak_ptr_factory_.GetWeakPtr(), snapshot_info)); |
| 298 } | 299 } |
| 299 | 300 |
| 300 void RecentTabHelper::SavePageCallback(SnapshotProgressInfo* snapshot_info, | 301 void RecentTabHelper::SavePageCallback(SnapshotProgressInfo* snapshot_info, |
| 301 OfflinePageModel::SavePageResult result, | 302 OfflinePageModel::SavePageResult result, |
| 302 int64_t offline_id) { | 303 int64_t offline_id) { |
| 303 DCHECK(snapshot_info->IsForLastN() || | 304 DCHECK(snapshot_info->IsForLastN() || |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 else | 346 else |
| 346 request_coordinator->EnableForOffliner(snapshot_info->request_id, | 347 request_coordinator->EnableForOffliner(snapshot_info->request_id, |
| 347 snapshot_info->client_id); | 348 snapshot_info->client_id); |
| 348 } | 349 } |
| 349 | 350 |
| 350 ClientId RecentTabHelper::GetRecentPagesClientId() const { | 351 ClientId RecentTabHelper::GetRecentPagesClientId() const { |
| 351 return ClientId(kLastNNamespace, tab_id_); | 352 return ClientId(kLastNNamespace, tab_id_); |
| 352 } | 353 } |
| 353 | 354 |
| 354 } // namespace offline_pages | 355 } // namespace offline_pages |
| OLD | NEW |