OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #if !defined(OS_CHROMEOS) | 10 #if !defined(OS_CHROMEOS) |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 wrapper->print_view_manager()->set_observer(NULL); | 888 wrapper->print_view_manager()->set_observer(NULL); |
889 } | 889 } |
890 | 890 |
891 void PrintPreviewHandler::OnPrintPreviewFailed() { | 891 void PrintPreviewHandler::OnPrintPreviewFailed() { |
892 if (reported_failed_preview_) | 892 if (reported_failed_preview_) |
893 return; | 893 return; |
894 reported_failed_preview_ = true; | 894 reported_failed_preview_ = true; |
895 ReportUserActionHistogram(PREVIEW_FAILED); | 895 ReportUserActionHistogram(PREVIEW_FAILED); |
896 } | 896 } |
897 | 897 |
| 898 void PrintPreviewHandler::ShowSystemDialog() { |
| 899 HandleShowSystemDialog(NULL); |
| 900 } |
| 901 |
898 void PrintPreviewHandler::FileSelected(const FilePath& path, | 902 void PrintPreviewHandler::FileSelected(const FilePath& path, |
899 int index, void* params) { | 903 int index, void* params) { |
900 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); | 904 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_); |
901 scoped_refptr<RefCountedBytes> data; | 905 scoped_refptr<RefCountedBytes> data; |
902 print_preview_ui->GetPrintPreviewDataForIndex( | 906 print_preview_ui->GetPrintPreviewDataForIndex( |
903 printing::COMPLETE_PREVIEW_DOCUMENT_INDEX, &data); | 907 printing::COMPLETE_PREVIEW_DOCUMENT_INDEX, &data); |
904 if (!data.get()) { | 908 if (!data.get()) { |
905 NOTREACHED(); | 909 NOTREACHED(); |
906 return; | 910 return; |
907 } | 911 } |
(...skipping 29 matching lines...) Expand all Loading... |
937 return; | 941 return; |
938 | 942 |
939 // We no longer require the initiator tab details. Remove those details | 943 // We no longer require the initiator tab details. Remove those details |
940 // associated with the preview tab to allow the initiator tab to create | 944 // associated with the preview tab to allow the initiator tab to create |
941 // another preview tab. | 945 // another preview tab. |
942 printing::PrintPreviewTabController* tab_controller = | 946 printing::PrintPreviewTabController* tab_controller = |
943 printing::PrintPreviewTabController::GetInstance(); | 947 printing::PrintPreviewTabController::GetInstance(); |
944 if (tab_controller) | 948 if (tab_controller) |
945 tab_controller->EraseInitiatorTabInfo(preview_tab()); | 949 tab_controller->EraseInitiatorTabInfo(preview_tab()); |
946 } | 950 } |
OLD | NEW |