| 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 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 // Pre-populating select file dialog with print job title. | 880 // Pre-populating select file dialog with print job title. |
| 881 base::string16 print_job_title_utf16 = print_preview_ui->initiator_title(); | 881 base::string16 print_job_title_utf16 = print_preview_ui->initiator_title(); |
| 882 | 882 |
| 883 #if defined(OS_WIN) | 883 #if defined(OS_WIN) |
| 884 base::FilePath::StringType print_job_title(print_job_title_utf16); | 884 base::FilePath::StringType print_job_title(print_job_title_utf16); |
| 885 #elif defined(OS_POSIX) | 885 #elif defined(OS_POSIX) |
| 886 base::FilePath::StringType print_job_title = | 886 base::FilePath::StringType print_job_title = |
| 887 base::UTF16ToUTF8(print_job_title_utf16); | 887 base::UTF16ToUTF8(print_job_title_utf16); |
| 888 #endif | 888 #endif |
| 889 | 889 |
| 890 file_util::ReplaceIllegalCharactersInPath(&print_job_title, '_'); | 890 base::i18n::ReplaceIllegalCharactersInPath(&print_job_title, '_'); |
| 891 base::FilePath default_filename(print_job_title); | 891 base::FilePath default_filename(print_job_title); |
| 892 default_filename = | 892 default_filename = |
| 893 default_filename.ReplaceExtension(FILE_PATH_LITERAL("pdf")); | 893 default_filename.ReplaceExtension(FILE_PATH_LITERAL("pdf")); |
| 894 | 894 |
| 895 SelectFile(default_filename); | 895 SelectFile(default_filename); |
| 896 } | 896 } |
| 897 } | 897 } |
| 898 | 898 |
| 899 void PrintPreviewHandler::HandleHidePreview(const base::ListValue* /*args*/) { | 899 void PrintPreviewHandler::HandleHidePreview(const base::ListValue* /*args*/) { |
| 900 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 900 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 | 1562 |
| 1563 void PrintPreviewHandler::UnregisterForMergeSession() { | 1563 void PrintPreviewHandler::UnregisterForMergeSession() { |
| 1564 if (reconcilor_) | 1564 if (reconcilor_) |
| 1565 reconcilor_->RemoveMergeSessionObserver(this); | 1565 reconcilor_->RemoveMergeSessionObserver(this); |
| 1566 } | 1566 } |
| 1567 | 1567 |
| 1568 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1568 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
| 1569 const base::Closure& closure) { | 1569 const base::Closure& closure) { |
| 1570 pdf_file_saved_closure_ = closure; | 1570 pdf_file_saved_closure_ = closure; |
| 1571 } | 1571 } |
| OLD | NEW |