| 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/renderer/print_web_view_helper.h" | 5 #include "chrome/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 if (!web_view) | 1275 if (!web_view) |
| 1276 web_view = render_view()->GetWebView(); | 1276 web_view = render_view()->GetWebView(); |
| 1277 | 1277 |
| 1278 render_view()->RunModalAlertDialog( | 1278 render_view()->RunModalAlertDialog( |
| 1279 web_view->mainFrame(), | 1279 web_view->mainFrame(), |
| 1280 l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT)); | 1280 l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT)); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 void PrintWebViewHelper::RequestPrintPreview() { | 1283 void PrintWebViewHelper::RequestPrintPreview() { |
| 1284 old_print_pages_params_.reset(); | 1284 old_print_pages_params_.reset(); |
| 1285 Send(new PrintHostMsg_RequestPrintPreview(routing_id())); | 1285 Send(new PrintHostMsg_RequestPrintPreview( |
| 1286 routing_id(), print_preview_context_.IsModifiable())); |
| 1286 } | 1287 } |
| 1287 | 1288 |
| 1288 bool PrintWebViewHelper::CheckForCancel() { | 1289 bool PrintWebViewHelper::CheckForCancel() { |
| 1289 bool cancel = false; | 1290 bool cancel = false; |
| 1290 Send(new PrintHostMsg_CheckForCancel( | 1291 Send(new PrintHostMsg_CheckForCancel( |
| 1291 routing_id(), | 1292 routing_id(), |
| 1292 print_pages_params_->params.preview_ui_addr, | 1293 print_pages_params_->params.preview_ui_addr, |
| 1293 print_pages_params_->params.preview_request_id, | 1294 print_pages_params_->params.preview_request_id, |
| 1294 &cancel)); | 1295 &cancel)); |
| 1295 if (cancel) | 1296 if (cancel) |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 DCHECK(IsRendering()); | 1563 DCHECK(IsRendering()); |
| 1563 return prep_frame_view_->GetPrintCanvasSize(); | 1564 return prep_frame_view_->GetPrintCanvasSize(); |
| 1564 } | 1565 } |
| 1565 | 1566 |
| 1566 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { | 1567 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { |
| 1567 prep_frame_view_.reset(); | 1568 prep_frame_view_.reset(); |
| 1568 metafile_.reset(); | 1569 metafile_.reset(); |
| 1569 pages_to_render_.clear(); | 1570 pages_to_render_.clear(); |
| 1570 error_ = PREVIEW_ERROR_NONE; | 1571 error_ = PREVIEW_ERROR_NONE; |
| 1571 } | 1572 } |
| OLD | NEW |