| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "chrome/browser/tab_contents/tab_contents_observer.h" |
| 10 |
| 11 struct ViewHostMsg_DidPreviewDocument_Params; |
| 12 |
| 13 namespace printing { |
| 14 |
| 15 // TabContents offloads print preview message handling to |
| 16 // PrintPreviewMessageHandler. This object has the same life time as the |
| 17 // TabContents that owns it. |
| 18 class PrintPreviewMessageHandler : public TabContentsObserver { |
| 19 public: |
| 20 explicit PrintPreviewMessageHandler(TabContents* owner); |
| 21 virtual ~PrintPreviewMessageHandler(); |
| 22 |
| 23 void OnPagesReadyForPreview( |
| 24 const ViewHostMsg_DidPreviewDocument_Params& params); |
| 25 |
| 26 // TabContentsObserver implementation. |
| 27 virtual bool OnMessageReceived(const IPC::Message& message); |
| 28 |
| 29 private: |
| 30 // Get the print preview tab associated with |owner_| or create a new print |
| 31 // preview tab if necessary. |
| 32 TabContents* GetOrCreatePrintPreviewTab(); |
| 33 |
| 34 // The TabContents that owns this PrintPreviewMessageHandler. |
| 35 TabContents* owner_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler); |
| 38 }; |
| 39 |
| 40 } // namespace printing |
| 41 |
| 42 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_ |
| OLD | NEW |