| 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/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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 45 #include "ui/base/layout.h" | 45 #include "ui/base/layout.h" |
| 46 #include "ui/gfx/rect.h" | 46 #include "ui/gfx/rect.h" |
| 47 #include "ui/gfx/skia_util.h" | 47 #include "ui/gfx/skia_util.h" |
| 48 #include "webkit/glue/webpreferences.h" | 48 #include "webkit/glue/webpreferences.h" |
| 49 | 49 |
| 50 #if defined(OS_POSIX) | 50 #if defined(OS_POSIX) |
| 51 #include "base/process_util.h" | 51 #include "base/process_util.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 #if defined(OS_WIN) // Currently Windows only | 54 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 55 #define USE_RENDER_TEXT | 55 #define USE_RENDER_TEXT |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 #if defined(USE_RENDER_TEXT) | 58 #if defined(USE_RENDER_TEXT) |
| 59 #include "ui/gfx/canvas.h" | 59 #include "ui/gfx/canvas.h" |
| 60 #include "ui/gfx/render_text.h" | 60 #include "ui/gfx/render_text.h" |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 using printing::ConvertPixelsToPoint; | 63 using printing::ConvertPixelsToPoint; |
| 64 using printing::ConvertPixelsToPointDouble; | 64 using printing::ConvertPixelsToPointDouble; |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1880 DCHECK(IsRendering()); | 1880 DCHECK(IsRendering()); |
| 1881 return prep_frame_view_->GetPrintCanvasSize(); | 1881 return prep_frame_view_->GetPrintCanvasSize(); |
| 1882 } | 1882 } |
| 1883 | 1883 |
| 1884 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { | 1884 void PrintWebViewHelper::PrintPreviewContext::ClearContext() { |
| 1885 prep_frame_view_.reset(); | 1885 prep_frame_view_.reset(); |
| 1886 metafile_.reset(); | 1886 metafile_.reset(); |
| 1887 pages_to_render_.clear(); | 1887 pages_to_render_.clear(); |
| 1888 error_ = PREVIEW_ERROR_NONE; | 1888 error_ = PREVIEW_ERROR_NONE; |
| 1889 } | 1889 } |
| OLD | NEW |