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_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 | 1466 |
1467 void PrintPreviewHandler::PostPrintToPdfTask() { | 1467 void PrintPreviewHandler::PostPrintToPdfTask() { |
1468 scoped_refptr<base::RefCountedBytes> data; | 1468 scoped_refptr<base::RefCountedBytes> data; |
1469 base::string16 title; | 1469 base::string16 title; |
1470 if (!GetPreviewDataAndTitle(&data, &title)) { | 1470 if (!GetPreviewDataAndTitle(&data, &title)) { |
1471 NOTREACHED() << "Preview data was checked before file dialog."; | 1471 NOTREACHED() << "Preview data was checked before file dialog."; |
1472 return; | 1472 return; |
1473 } | 1473 } |
1474 | 1474 |
1475 base::PostTaskWithTraits( | 1475 base::PostTaskWithTraits( |
1476 FROM_HERE, base::TaskTraits().MayBlock().WithPriority( | 1476 FROM_HERE, |
1477 base::TaskPriority::BACKGROUND), | 1477 base::TaskTraits().MayBlock().WithPriority( |
1478 base::Bind(&PrintToPdfCallback, data, print_to_pdf_path_, | 1478 base::TaskPriority::BACKGROUND), |
1479 pdf_file_saved_closure_)); | 1479 base::BindOnce(&PrintToPdfCallback, data, print_to_pdf_path_, |
| 1480 pdf_file_saved_closure_)); |
1480 print_to_pdf_path_.clear(); | 1481 print_to_pdf_path_.clear(); |
1481 ClosePreviewDialog(); | 1482 ClosePreviewDialog(); |
1482 } | 1483 } |
1483 | 1484 |
1484 void PrintPreviewHandler::FileSelectionCanceled(void* params) { | 1485 void PrintPreviewHandler::FileSelectionCanceled(void* params) { |
1485 print_preview_ui()->OnFileSelectionCancelled(); | 1486 print_preview_ui()->OnFileSelectionCancelled(); |
1486 } | 1487 } |
1487 | 1488 |
1488 void PrintPreviewHandler::ClearInitiatorDetails() { | 1489 void PrintPreviewHandler::ClearInitiatorDetails() { |
1489 WebContents* initiator = GetInitiator(); | 1490 WebContents* initiator = GetInitiator(); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 | 1795 |
1795 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { | 1796 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { |
1796 if (gaia_cookie_manager_service_) | 1797 if (gaia_cookie_manager_service_) |
1797 gaia_cookie_manager_service_->RemoveObserver(this); | 1798 gaia_cookie_manager_service_->RemoveObserver(this); |
1798 } | 1799 } |
1799 | 1800 |
1800 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1801 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1801 const base::Closure& closure) { | 1802 const base::Closure& closure) { |
1802 pdf_file_saved_closure_ = closure; | 1803 pdf_file_saved_closure_ = closure; |
1803 } | 1804 } |
OLD | NEW |