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/renderer/printing/print_web_view_helper.h" | 5 #include "chrome/renderer/printing/print_web_view_helper.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 | 1298 |
1299 int page_count = prep_frame_view_->GetExpectedPageCount(); | 1299 int page_count = prep_frame_view_->GetExpectedPageCount(); |
1300 if (!page_count) { | 1300 if (!page_count) { |
1301 LOG(ERROR) << "Can't print 0 pages."; | 1301 LOG(ERROR) << "Can't print 0 pages."; |
1302 return DidFinishPrinting(FAIL_PRINT); | 1302 return DidFinishPrinting(FAIL_PRINT); |
1303 } | 1303 } |
1304 | 1304 |
1305 const PrintMsg_PrintPages_Params& params = *print_pages_params_; | 1305 const PrintMsg_PrintPages_Params& params = *print_pages_params_; |
1306 const PrintMsg_Print_Params& print_params = params.params; | 1306 const PrintMsg_Print_Params& print_params = params.params; |
1307 | 1307 |
1308 #if !defined(OS_CHROMEOS) | 1308 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
1309 // TODO(vitalybuka): should be page_count or valid pages from params.pages. | 1309 // TODO(vitalybuka): should be page_count or valid pages from params.pages. |
1310 // See http://crbug.com/161576 | 1310 // See http://crbug.com/161576 |
1311 Send(new PrintHostMsg_DidGetPrintedPagesCount(routing_id(), | 1311 Send(new PrintHostMsg_DidGetPrintedPagesCount(routing_id(), |
1312 print_params.document_cookie, | 1312 print_params.document_cookie, |
1313 page_count)); | 1313 page_count)); |
1314 #endif // !defined(OS_CHROMEOS) | 1314 #endif // !defined(OS_CHROMEOS) |
1315 | 1315 |
1316 if (print_params.preview_ui_id < 0) { | 1316 if (print_params.preview_ui_id < 0) { |
1317 // Printing for system dialog. | 1317 // Printing for system dialog. |
1318 int printed_count = params.pages.empty() ? page_count : params.pages.size(); | 1318 int printed_count = params.pages.empty() ? page_count : params.pages.size(); |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 } | 1979 } |
1980 | 1980 |
1981 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { | 1981 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { |
1982 prep_frame_view_.reset(); | 1982 prep_frame_view_.reset(); |
1983 metafile_.reset(); | 1983 metafile_.reset(); |
1984 pages_to_render_.clear(); | 1984 pages_to_render_.clear(); |
1985 error_ = PREVIEW_ERROR_NONE; | 1985 error_ = PREVIEW_ERROR_NONE; |
1986 } | 1986 } |
1987 | 1987 |
1988 } // namespace printing | 1988 } // namespace printing |
OLD | NEW |