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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 virtual ~PrintPreviewMessageHandler(); | 35 virtual ~PrintPreviewMessageHandler(); |
36 | 36 |
37 // content::WebContentsObserver implementation. | 37 // content::WebContentsObserver implementation. |
38 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 38 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
39 | 39 |
40 private: | 40 private: |
41 explicit PrintPreviewMessageHandler(content::WebContents* web_contents); | 41 explicit PrintPreviewMessageHandler(content::WebContents* web_contents); |
42 friend class content::WebContentsUserData<PrintPreviewMessageHandler>; | 42 friend class content::WebContentsUserData<PrintPreviewMessageHandler>; |
43 | 43 |
44 // Gets the print preview tab associated with the WebContents being observed. | 44 // Gets the print preview dialog associated with the WebContents being |
45 content::WebContents* GetPrintPreviewTab(); | 45 // observed. |
| 46 content::WebContents* GetPrintPreviewDialog(); |
46 | 47 |
47 // Gets the PrintPreviewUI associated with the WebContents being observed. | 48 // Gets the PrintPreviewUI associated with the WebContents being observed. |
48 PrintPreviewUI* GetPrintPreviewUI(); | 49 PrintPreviewUI* GetPrintPreviewUI(); |
49 | 50 |
50 // Message handlers. | 51 // Message handlers. |
51 void OnRequestPrintPreview( | 52 void OnRequestPrintPreview( |
52 const PrintHostMsg_RequestPrintPreview_Params& params); | 53 const PrintHostMsg_RequestPrintPreview_Params& params); |
53 void OnDidGetDefaultPageLayout( | 54 void OnDidGetDefaultPageLayout( |
54 const printing::PageSizeMargins& page_layout_in_points, | 55 const printing::PageSizeMargins& page_layout_in_points, |
55 const gfx::Rect& printable_area_in_points, | 56 const gfx::Rect& printable_area_in_points, |
56 bool has_custom_page_size_style); | 57 bool has_custom_page_size_style); |
57 void OnDidGetPreviewPageCount( | 58 void OnDidGetPreviewPageCount( |
58 const PrintHostMsg_DidGetPreviewPageCount_Params& params); | 59 const PrintHostMsg_DidGetPreviewPageCount_Params& params); |
59 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); | 60 void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params); |
60 void OnMetafileReadyForPrinting( | 61 void OnMetafileReadyForPrinting( |
61 const PrintHostMsg_DidPreviewDocument_Params& params); | 62 const PrintHostMsg_DidPreviewDocument_Params& params); |
62 void OnPrintPreviewFailed(int document_cookie); | 63 void OnPrintPreviewFailed(int document_cookie); |
63 void OnPrintPreviewCancelled(int document_cookie); | 64 void OnPrintPreviewCancelled(int document_cookie); |
64 void OnInvalidPrinterSettings(int document_cookie); | 65 void OnInvalidPrinterSettings(int document_cookie); |
65 void OnPrintPreviewScalingDisabled(); | 66 void OnPrintPreviewScalingDisabled(); |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); | 68 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); |
68 }; | 69 }; |
69 | 70 |
70 } // namespace printing | 71 } // namespace printing |
71 | 72 |
72 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ | 73 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
OLD | NEW |