Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2303)

Unified Diff: chrome/browser/printing/print_preview_message_handler.h

Issue 6334010: Print Preview: Store preview data in the print preview handler.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/print_preview_message_handler.h
===================================================================
--- chrome/browser/printing/print_preview_message_handler.h (revision 0)
+++ chrome/browser/printing/print_preview_message_handler.h (revision 0)
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
+#define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
+#pragma once
+
+#include "chrome/browser/tab_contents/tab_contents_observer.h"
+
+struct ViewHostMsg_DidPreviewDocument_Params;
+
+namespace printing {
+
+// TabContents offloads print preview message handling to
+// PrintPreviewMessageHandler. This object has the same life time as the
+// TabContents that owns it.
+class PrintPreviewMessageHandler : public TabContentsObserver {
+ public:
+ explicit PrintPreviewMessageHandler(TabContents* owner);
+ virtual ~PrintPreviewMessageHandler();
+
+ void OnPagesReadyForPreview(
+ const ViewHostMsg_DidPreviewDocument_Params& params);
+
+ // TabContentsObserver implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message);
+
+ private:
+ // Get the print preview tab associated with |owner_| or create a new print
+ // preview tab if necessary.
+ TabContents* GetOrCreatePrintPreviewTab();
+
+ // The TabContents that owns this PrintPreviewMessageHandler.
+ TabContents* owner_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintPreviewMessageHandler);
+};
+
+} // namespace printing
+
+#endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
Property changes on: chrome/browser/printing/print_preview_message_handler.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698