| 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 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 5 #ifndef CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 6 #define CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 private: | 97 private: |
| 98 friend class PrintWebViewHelperTestBase; | 98 friend class PrintWebViewHelperTestBase; |
| 99 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, | 99 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, |
| 100 BlockScriptInitiatedPrinting); | 100 BlockScriptInitiatedPrinting); |
| 101 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, OnPrintPages); | 101 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, OnPrintPages); |
| 102 | 102 |
| 103 #if defined(OS_WIN) || defined(OS_MACOSX) | 103 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 104 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintLayoutTest); | 104 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintLayoutTest); |
| 105 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintWithIframe); | 105 FRIEND_TEST_ALL_PREFIXES(PrintWebViewHelperTest, PrintWithIframe); |
| 106 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 106 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 107 #if defined(OS_WIN) && defined(USE_SKIA) |
| 108 friend class PrintWebViewHelperSkSandbox; |
| 109 #endif // defined(OS_WIN) && defined(USE_SKIA) |
| 107 | 110 |
| 108 // RenderViewObserver implementation. | 111 // RenderViewObserver implementation. |
| 109 virtual bool OnMessageReceived(const IPC::Message& message); | 112 virtual bool OnMessageReceived(const IPC::Message& message); |
| 110 virtual void PrintPage(WebKit::WebFrame* frame); | 113 virtual void PrintPage(WebKit::WebFrame* frame); |
| 111 | 114 |
| 112 // Message handlers --------------------------------------------------------- | 115 // Message handlers --------------------------------------------------------- |
| 113 | 116 |
| 114 // Print the document. | 117 // Print the document. |
| 115 void OnPrintPages(); | 118 void OnPrintPages(); |
| 116 | 119 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 const float& scale_factor, int page_number, | 228 const float& scale_factor, int page_number, |
| 226 WebKit::WebFrame* frame, bool is_preview, | 229 WebKit::WebFrame* frame, bool is_preview, |
| 227 printing::Metafile* metafile); | 230 printing::Metafile* metafile); |
| 228 #elif defined(OS_POSIX) | 231 #elif defined(OS_POSIX) |
| 229 bool RenderPages(const PrintMsg_PrintPages_Params& params, | 232 bool RenderPages(const PrintMsg_PrintPages_Params& params, |
| 230 WebKit::WebFrame* frame, const WebKit::WebNode& node, | 233 WebKit::WebFrame* frame, const WebKit::WebNode& node, |
| 231 int* page_count, PrepareFrameAndViewForPrint* prepare, | 234 int* page_count, PrepareFrameAndViewForPrint* prepare, |
| 232 printing::Metafile* metafile); | 235 printing::Metafile* metafile); |
| 233 #endif // defined(OS_WIN) | 236 #endif // defined(OS_WIN) |
| 234 | 237 |
| 238 #if defined(OS_WIN) && defined(USE_SKIA) |
| 239 bool EnsureFontLoad(LOGFONT logfont); |
| 240 #endif |
| 241 |
| 235 // Helper methods ----------------------------------------------------------- | 242 // Helper methods ----------------------------------------------------------- |
| 236 | 243 |
| 237 bool CopyAndPrint(WebKit::WebFrame* web_frame); | 244 bool CopyAndPrint(WebKit::WebFrame* web_frame); |
| 238 | 245 |
| 239 bool CopyMetafileDataToSharedMem(printing::Metafile* metafile, | 246 bool CopyMetafileDataToSharedMem(printing::Metafile* metafile, |
| 240 base::SharedMemoryHandle* shared_mem_handle); | 247 base::SharedMemoryHandle* shared_mem_handle); |
| 241 | 248 |
| 242 static void GetPageSizeAndMarginsInPoints( | 249 static void GetPageSizeAndMarginsInPoints( |
| 243 WebKit::WebFrame* frame, | 250 WebKit::WebFrame* frame, |
| 244 int page_index, | 251 int page_index, |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 431 |
| 425 State state_; | 432 State state_; |
| 426 }; | 433 }; |
| 427 | 434 |
| 428 PrintPreviewContext print_preview_context_; | 435 PrintPreviewContext print_preview_context_; |
| 429 | 436 |
| 430 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); | 437 DISALLOW_COPY_AND_ASSIGN(PrintWebViewHelper); |
| 431 }; | 438 }; |
| 432 | 439 |
| 433 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ | 440 #endif // CHROME_RENDERER_PRINT_WEB_VIEW_HELPER_H_ |
| OLD | NEW |