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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 PRINT_TO_PRINTER, | 100 PRINT_TO_PRINTER, |
101 PRINT_TO_PDF, | 101 PRINT_TO_PDF, |
102 CANCEL, | 102 CANCEL, |
103 FALLBACK_TO_ADVANCED_SETTINGS_DIALOG, | 103 FALLBACK_TO_ADVANCED_SETTINGS_DIALOG, |
104 PREVIEW_FAILED, | 104 PREVIEW_FAILED, |
105 PREVIEW_STARTED, | 105 PREVIEW_STARTED, |
106 INITIATOR_CRASHED, // UNUSED | 106 INITIATOR_CRASHED, // UNUSED |
107 INITIATOR_CLOSED, | 107 INITIATOR_CLOSED, |
108 PRINT_WITH_CLOUD_PRINT, | 108 PRINT_WITH_CLOUD_PRINT, |
109 PRINT_WITH_PRIVET, | 109 PRINT_WITH_PRIVET, |
110 PRINT_WITH_EXTENSION, | |
110 USERACTION_BUCKET_BOUNDARY | 111 USERACTION_BUCKET_BOUNDARY |
111 }; | 112 }; |
112 | 113 |
113 enum PrintSettingsBuckets { | 114 enum PrintSettingsBuckets { |
114 LANDSCAPE = 0, | 115 LANDSCAPE = 0, |
115 PORTRAIT, | 116 PORTRAIT, |
116 COLOR, | 117 COLOR, |
117 BLACK_AND_WHITE, | 118 BLACK_AND_WHITE, |
118 COLLATE, | 119 COLLATE, |
119 SIMPLEX, | 120 SIMPLEX, |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
877 return; | 878 return; |
878 } | 879 } |
879 | 880 |
880 PrintToPrivetPrinter( | 881 PrintToPrivetPrinter( |
881 printer_name, print_ticket, capabilities, gfx::Size(width, height)); | 882 printer_name, print_ticket, capabilities, gfx::Size(width, height)); |
882 return; | 883 return; |
883 } | 884 } |
884 #endif | 885 #endif |
885 | 886 |
886 if (print_with_extension) { | 887 if (print_with_extension) { |
887 // TODO(tbarzic): Record UMA stats. | 888 UMA_HISTOGRAM_COUNTS("PrintPreview.PageCount.PrintWithExtension", |
889 page_count); | |
Ilya Sherman
2015/02/21 00:26:39
I bet that UMA_HISTOGRAM_COUNTS_100 or _10000 woul
| |
890 ReportUserActionHistogram(PRINT_WITH_EXTENSION); | |
888 | 891 |
889 std::string destination_id; | 892 std::string destination_id; |
890 std::string print_ticket; | 893 std::string print_ticket; |
891 std::string capabilities; | 894 std::string capabilities; |
892 int width = 0; | 895 int width = 0; |
893 int height = 0; | 896 int height = 0; |
894 if (!settings->GetString(printing::kSettingDeviceName, &destination_id) || | 897 if (!settings->GetString(printing::kSettingDeviceName, &destination_id) || |
895 !settings->GetString(printing::kSettingTicket, &print_ticket) || | 898 !settings->GetString(printing::kSettingTicket, &print_ticket) || |
896 !settings->GetString(printing::kSettingCapabilities, &capabilities) || | 899 !settings->GetString(printing::kSettingCapabilities, &capabilities) || |
897 !settings->GetInteger(printing::kSettingPageWidth, &width) || | 900 !settings->GetInteger(printing::kSettingPageWidth, &width) || |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1711 | 1714 |
1712 void PrintPreviewHandler::UnregisterForMergeSession() { | 1715 void PrintPreviewHandler::UnregisterForMergeSession() { |
1713 if (reconcilor_) | 1716 if (reconcilor_) |
1714 reconcilor_->RemoveMergeSessionObserver(this); | 1717 reconcilor_->RemoveMergeSessionObserver(this); |
1715 } | 1718 } |
1716 | 1719 |
1717 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1720 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1718 const base::Closure& closure) { | 1721 const base::Closure& closure) { |
1719 pdf_file_saved_closure_ = closure; | 1722 pdf_file_saved_closure_ = closure; |
1720 } | 1723 } |
OLD | NEW |