| 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
| 11 | 11 |
| 12 class PrintPreviewUI; | 12 class PrintPreviewUI; |
| 13 struct PrintHostMsg_DidGetPreviewPageCount_Params; | 13 struct PrintHostMsg_DidGetPreviewPageCount_Params; |
| 14 struct PrintHostMsg_DidPreviewDocument_Params; | 14 struct PrintHostMsg_DidPreviewDocument_Params; |
| 15 struct PrintHostMsg_DidPreviewPage_Params; | 15 struct PrintHostMsg_DidPreviewPage_Params; |
| 16 struct PrintHostMsg_RequestPrintPreview_Params; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 class WebContents; | 19 class WebContents; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class Rect; | 23 class Rect; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace printing { | 26 namespace printing { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 explicit PrintPreviewMessageHandler(content::WebContents* web_contents); | 41 explicit PrintPreviewMessageHandler(content::WebContents* web_contents); |
| 41 friend class content::WebContentsUserData<PrintPreviewMessageHandler>; | 42 friend class content::WebContentsUserData<PrintPreviewMessageHandler>; |
| 42 | 43 |
| 43 // Gets the print preview tab associated with the WebContents being observed. | 44 // Gets the print preview tab associated with the WebContents being observed. |
| 44 content::WebContents* GetPrintPreviewTab(); | 45 content::WebContents* GetPrintPreviewTab(); |
| 45 | 46 |
| 46 // Gets the PrintPreviewUI associated with the WebContents being observed. | 47 // Gets the PrintPreviewUI associated with the WebContents being observed. |
| 47 PrintPreviewUI* GetPrintPreviewUI(); | 48 PrintPreviewUI* GetPrintPreviewUI(); |
| 48 | 49 |
| 49 // Message handlers. | 50 // Message handlers. |
| 50 void OnRequestPrintPreview(bool source_is_modifiable, | 51 void OnRequestPrintPreview( |
| 51 bool webnode_only, | 52 const PrintHostMsg_RequestPrintPreview_Params& params); |
| 52 bool source_has_selection); | |
| 53 void OnDidGetDefaultPageLayout( | 53 void OnDidGetDefaultPageLayout( |
| 54 const printing::PageSizeMargins& page_layout_in_points, | 54 const printing::PageSizeMargins& page_layout_in_points, |
| 55 const gfx::Rect& printable_area_in_points, | 55 const gfx::Rect& printable_area_in_points, |
| 56 bool has_custom_page_size_style); | 56 bool has_custom_page_size_style); |
| 57 void OnDidGetPreviewPageCount( | 57 void OnDidGetPreviewPageCount( |
| 58 const PrintHostMsg_DidGetPreviewPageCount_Params& params); | 58 const PrintHostMsg_DidGetPreviewPageCount_Params& params); |
| 59 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); | 59 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); |
| 60 void OnMetafileReadyForPrinting( | 60 void OnMetafileReadyForPrinting( |
| 61 const PrintHostMsg_DidPreviewDocument_Params& params); | 61 const PrintHostMsg_DidPreviewDocument_Params& params); |
| 62 void OnPrintPreviewFailed(int document_cookie); | 62 void OnPrintPreviewFailed(int document_cookie); |
| 63 void OnPrintPreviewCancelled(int document_cookie); | 63 void OnPrintPreviewCancelled(int document_cookie); |
| 64 void OnInvalidPrinterSettings(int document_cookie); | 64 void OnInvalidPrinterSettings(int document_cookie); |
| 65 void OnPrintPreviewScalingDisabled(); | 65 void OnPrintPreviewScalingDisabled(); |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); | 67 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace printing | 70 } // namespace printing |
| 71 | 71 |
| 72 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ | 72 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| OLD | NEW |