| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/print_preview/print_preview_ui.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 435 } |
| 436 | 436 |
| 437 void PrintPreviewUI::GetPrintPreviewDataForIndex( | 437 void PrintPreviewUI::GetPrintPreviewDataForIndex( |
| 438 int index, | 438 int index, |
| 439 scoped_refptr<base::RefCountedBytes>* data) { | 439 scoped_refptr<base::RefCountedBytes>* data) { |
| 440 print_preview_data_service()->GetDataEntry(id_, index, data); | 440 print_preview_data_service()->GetDataEntry(id_, index, data); |
| 441 } | 441 } |
| 442 | 442 |
| 443 void PrintPreviewUI::SetPrintPreviewDataForIndex( | 443 void PrintPreviewUI::SetPrintPreviewDataForIndex( |
| 444 int index, | 444 int index, |
| 445 const base::RefCountedBytes* data) { | 445 scoped_refptr<base::RefCountedBytes> data) { |
| 446 print_preview_data_service()->SetDataEntry(id_, index, data); | 446 print_preview_data_service()->SetDataEntry(id_, index, std::move(data)); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void PrintPreviewUI::ClearAllPreviewData() { | 449 void PrintPreviewUI::ClearAllPreviewData() { |
| 450 print_preview_data_service()->RemoveEntry(id_); | 450 print_preview_data_service()->RemoveEntry(id_); |
| 451 } | 451 } |
| 452 | 452 |
| 453 int PrintPreviewUI::GetAvailableDraftPageCount() { | 453 int PrintPreviewUI::GetAvailableDraftPageCount() { |
| 454 return print_preview_data_service()->GetAvailableDraftPageCount(id_); | 454 return print_preview_data_service()->GetAvailableDraftPageCount(id_); |
| 455 } | 455 } |
| 456 | 456 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 } | 669 } |
| 670 | 670 |
| 671 void PrintPreviewUI::SetPdfSavedClosureForTesting( | 671 void PrintPreviewUI::SetPdfSavedClosureForTesting( |
| 672 const base::Closure& closure) { | 672 const base::Closure& closure) { |
| 673 handler_->SetPdfSavedClosureForTesting(closure); | 673 handler_->SetPdfSavedClosureForTesting(closure); |
| 674 } | 674 } |
| 675 | 675 |
| 676 base::WeakPtr<PrintPreviewUI> PrintPreviewUI::GetWeakPtr() { | 676 base::WeakPtr<PrintPreviewUI> PrintPreviewUI::GetWeakPtr() { |
| 677 return weak_ptr_factory_.GetWeakPtr(); | 677 return weak_ptr_factory_.GetWeakPtr(); |
| 678 } | 678 } |
| OLD | NEW |