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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 ReportPrintSettingsStats(*settings); | 553 ReportPrintSettingsStats(*settings); |
554 ReportUserActionHistogram(PRINT_TO_PRINTER); | 554 ReportUserActionHistogram(PRINT_TO_PRINTER); |
555 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToPrinter", | 555 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintToPrinter", |
556 GetPageCountFromSettingsDictionary(*settings)); | 556 GetPageCountFromSettingsDictionary(*settings)); |
557 | 557 |
558 HidePreviewTab(); | 558 HidePreviewTab(); |
559 | 559 |
560 // The PDF being printed contains only the pages that the user selected, | 560 // The PDF being printed contains only the pages that the user selected, |
561 // so ignore the page range and print all pages. | 561 // so ignore the page range and print all pages. |
562 settings->Remove(printing::kSettingPageRange, NULL); | 562 settings->Remove(printing::kSettingPageRange, NULL); |
563 RenderViewHost* rvh = web_ui_->GetRenderViewHost(); | 563 RenderViewHost* rvh = web_ui_->tab_contents()->render_view_host(); |
564 rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->routing_id(), *settings)); | 564 rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->routing_id(), *settings)); |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 void PrintPreviewHandler::HandleHidePreview(const ListValue* args) { | 568 void PrintPreviewHandler::HandleHidePreview(const ListValue* args) { |
569 HidePreviewTab(); | 569 HidePreviewTab(); |
570 } | 570 } |
571 | 571 |
572 void PrintPreviewHandler::HandleCancelPendingPrintRequest( | 572 void PrintPreviewHandler::HandleCancelPendingPrintRequest( |
573 const ListValue* args) { | 573 const ListValue* args) { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 return; | 887 return; |
888 | 888 |
889 // We no longer require the initiator tab details. Remove those details | 889 // We no longer require the initiator tab details. Remove those details |
890 // associated with the preview tab to allow the initiator tab to create | 890 // associated with the preview tab to allow the initiator tab to create |
891 // another preview tab. | 891 // another preview tab. |
892 printing::PrintPreviewTabController* tab_controller = | 892 printing::PrintPreviewTabController* tab_controller = |
893 printing::PrintPreviewTabController::GetInstance(); | 893 printing::PrintPreviewTabController::GetInstance(); |
894 if (tab_controller) | 894 if (tab_controller) |
895 tab_controller->EraseInitiatorTabInfo(preview_tab()); | 895 tab_controller->EraseInitiatorTabInfo(preview_tab()); |
896 } | 896 } |
OLD | NEW |