| 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_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 observer_(NULL), | 41 observer_(NULL), |
| 42 print_preview_state_(NOT_PREVIEWING), | 42 print_preview_state_(NOT_PREVIEWING), |
| 43 scripted_print_preview_rph_(NULL) { | 43 scripted_print_preview_rph_(NULL) { |
| 44 } | 44 } |
| 45 | 45 |
| 46 PrintViewManager::~PrintViewManager() { | 46 PrintViewManager::~PrintViewManager() { |
| 47 DCHECK_EQ(NOT_PREVIEWING, print_preview_state_); | 47 DCHECK_EQ(NOT_PREVIEWING, print_preview_state_); |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool PrintViewManager::PrintForSystemDialogNow() { | 50 bool PrintViewManager::PrintForSystemDialogNow() { |
| 51 #if defined(OS_WIN) |
| 52 NOTREACHED(); |
| 53 #endif |
| 51 return PrintNowInternal(new PrintMsg_PrintForSystemDialog(routing_id())); | 54 return PrintNowInternal(new PrintMsg_PrintForSystemDialog(routing_id())); |
| 52 } | 55 } |
| 53 | 56 |
| 54 bool PrintViewManager::AdvancedPrintNow() { | 57 bool PrintViewManager::AdvancedPrintNow() { |
| 55 PrintPreviewDialogController* dialog_controller = | 58 PrintPreviewDialogController* dialog_controller = |
| 56 PrintPreviewDialogController::GetInstance(); | 59 PrintPreviewDialogController::GetInstance(); |
| 57 if (!dialog_controller) | 60 if (!dialog_controller) |
| 58 return false; | 61 return false; |
| 59 content::WebContents* print_preview_dialog = | 62 content::WebContents* print_preview_dialog = |
| 60 dialog_controller->GetPrintPreviewForContents(web_contents()); | 63 dialog_controller->GetPrintPreviewForContents(web_contents()); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 OnSetupScriptedPrintPreview) | 200 OnSetupScriptedPrintPreview) |
| 198 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, | 201 IPC_MESSAGE_HANDLER(PrintHostMsg_ShowScriptedPrintPreview, |
| 199 OnShowScriptedPrintPreview) | 202 OnShowScriptedPrintPreview) |
| 200 IPC_MESSAGE_UNHANDLED(handled = false) | 203 IPC_MESSAGE_UNHANDLED(handled = false) |
| 201 IPC_END_MESSAGE_MAP() | 204 IPC_END_MESSAGE_MAP() |
| 202 | 205 |
| 203 return handled ? true : PrintViewManagerBase::OnMessageReceived(message); | 206 return handled ? true : PrintViewManagerBase::OnMessageReceived(message); |
| 204 } | 207 } |
| 205 | 208 |
| 206 } // namespace printing | 209 } // namespace printing |
| OLD | NEW |