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/printing/print_preview_message_handler.h" | 5 #include "chrome/browser/printing/print_preview_message_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
194 print_preview_ui->OnInvalidPrinterSettings(); | 194 print_preview_ui->OnInvalidPrinterSettings(); |
195 } | 195 } |
196 | 196 |
197 void PrintPreviewMessageHandler::OnPrintPreviewScalingDisabled() { | 197 void PrintPreviewMessageHandler::OnPrintPreviewScalingDisabled() { |
198 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI(); | 198 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI(); |
199 if (!print_preview_ui) | 199 if (!print_preview_ui) |
200 return; | 200 return; |
201 print_preview_ui->OnPrintPreviewScalingDisabled(); | 201 print_preview_ui->OnPrintPreviewScalingDisabled(); |
202 } | 202 } |
203 | 203 |
204 void PrintPreviewMessageHandler::OnPrintPreviewNumCopies(int num_copies) { | |
Vitaly Buka (NO REVIEWS)
2014/07/10 01:13:04
PrintPreviewNumCopies -> PrintPreviewSetCopies
Nikhil
2014/07/16 13:52:55
Removed, OnSetOptionsFromDocument() will be used.
| |
205 PrintPreviewUI* print_preview_ui = GetPrintPreviewUI(); | |
206 if (!print_preview_ui) | |
207 return; | |
208 print_preview_ui->OnPrintPreviewNumCopies(num_copies); | |
209 } | |
210 | |
204 bool PrintPreviewMessageHandler::OnMessageReceived( | 211 bool PrintPreviewMessageHandler::OnMessageReceived( |
205 const IPC::Message& message) { | 212 const IPC::Message& message) { |
206 bool handled = true; | 213 bool handled = true; |
207 IPC_BEGIN_MESSAGE_MAP(PrintPreviewMessageHandler, message) | 214 IPC_BEGIN_MESSAGE_MAP(PrintPreviewMessageHandler, message) |
208 IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, | 215 IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, |
209 OnRequestPrintPreview) | 216 OnRequestPrintPreview) |
210 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount, | 217 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount, |
211 OnDidGetPreviewPageCount) | 218 OnDidGetPreviewPageCount) |
212 IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, | 219 IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, |
213 OnDidPreviewPage) | 220 OnDidPreviewPage) |
214 IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, | 221 IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, |
215 OnMetafileReadyForPrinting) | 222 OnMetafileReadyForPrinting) |
216 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed, | 223 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed, |
217 OnPrintPreviewFailed) | 224 OnPrintPreviewFailed) |
218 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout, | 225 IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout, |
219 OnDidGetDefaultPageLayout) | 226 OnDidGetDefaultPageLayout) |
220 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewCancelled, | 227 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewCancelled, |
221 OnPrintPreviewCancelled) | 228 OnPrintPreviewCancelled) |
222 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings, | 229 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewInvalidPrinterSettings, |
223 OnInvalidPrinterSettings) | 230 OnInvalidPrinterSettings) |
224 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewScalingDisabled, | 231 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewScalingDisabled, |
225 OnPrintPreviewScalingDisabled) | 232 OnPrintPreviewScalingDisabled) |
233 IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewNumCopies, | |
234 OnPrintPreviewNumCopies) | |
226 IPC_MESSAGE_UNHANDLED(handled = false) | 235 IPC_MESSAGE_UNHANDLED(handled = false) |
227 IPC_END_MESSAGE_MAP() | 236 IPC_END_MESSAGE_MAP() |
228 return handled; | 237 return handled; |
229 } | 238 } |
230 | 239 |
231 } // namespace printing | 240 } // namespace printing |
OLD | NEW |