| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/print_messages.h" | 15 #include "chrome/common/print_messages.h" |
| 16 #include "chrome/common/render_messages.h" | 16 #include "chrome/common/render_messages.h" |
| 17 #include "chrome/common/url_constants.h" | 17 #include "chrome/common/url_constants.h" |
| 18 #include "chrome/renderer/prerender/prerender_helper.h" | 18 #include "chrome/renderer/prerender/prerender_helper.h" |
| 19 #include "content/public/renderer/render_thread.h" | 19 #include "content/public/renderer/render_thread.h" |
| 20 #include "content/public/renderer/render_view.h" | 20 #include "content/public/renderer/render_view.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "printing/metafile_impl.h" | 22 #include "printing/metafile_impl.h" |
| 23 #include "printing/page_size_margins.h" | 23 #include "printing/page_size_margins.h" |
| 24 #include "printing/print_job_constants.h" | 24 #include "printing/print_job_constants.h" |
| 25 #include "printing/units.h" | 25 #include "printing/units.h" |
| 26 #include "third_party/skia/include/core/SkRect.h" | 26 #include "third_party/skia/include/core/SkRect.h" |
| 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCanvas.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
| 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon
se.h" |
| 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 #include "webkit/glue/webpreferences.h" | 38 #include "webkit/glue/webpreferences.h" |
| 39 | 39 |
| 40 #if defined(OS_POSIX) | 40 #if defined(OS_POSIX) |
| 41 #include "base/process_util.h" | 41 #include "base/process_util.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 #if defined(USE_SKIA) | 44 #if defined(USE_SKIA) |
| 45 #include "skia/ext/vector_canvas.h" | 45 #include "skia/ext/vector_canvas.h" |
| (...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 DCHECK(IsRendering()); | 1557 DCHECK(IsRendering()); |
| 1558 return prep_frame_view_->GetPrintCanvasSize(); | 1558 return prep_frame_view_->GetPrintCanvasSize(); |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { | 1561 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { |
| 1562 prep_frame_view_.reset(); | 1562 prep_frame_view_.reset(); |
| 1563 metafile_.reset(); | 1563 metafile_.reset(); |
| 1564 pages_to_render_.clear(); | 1564 pages_to_render_.clear(); |
| 1565 error_ = PREVIEW_ERROR_NONE; | 1565 error_ = PREVIEW_ERROR_NONE; |
| 1566 } | 1566 } |
| OLD | NEW |