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

Unified Diff: chrome/browser/dom_ui/print_preview_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/dom_ui/print_preview_handler.h
===================================================================
--- chrome/browser/dom_ui/print_preview_handler.h (revision 72691)
+++ chrome/browser/dom_ui/print_preview_handler.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// 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.
@@ -6,21 +6,38 @@
#define CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_HANDLER_H_
#pragma once
-#include "base/scoped_ptr.h"
James Hawkins 2011/01/31 18:39:38 This is right to remove scoped_ptr.h, but now we n
Lei Zhang 2011/01/31 22:15:51 weak_ptr.h includes ref_counted.h, but I added it
+#include <utility>
+
#include "base/weak_ptr.h"
#include "chrome/browser/dom_ui/dom_ui.h"
+namespace base {
+class SharedMemory;
+}
+
namespace printing {
class PrintBackend;
-} // namespace printing
James Hawkins 2011/01/31 18:39:38 I realize there was disagreement on the list recen
Lei Zhang 2011/01/31 22:15:51 I've asked for the style guide to be updated to re
+}
// The handler for Javascript messages related to the "print preview" dialog.
class PrintPreviewHandler : public DOMMessageHandler,
public base::SupportsWeakPtr<PrintPreviewHandler> {
public:
+ typedef std::pair<base::SharedMemory*, uint32> PrintPreviewData;
James Hawkins 2011/01/31 18:39:38 Document this typedef.
Lei Zhang 2011/01/31 22:15:51 Done.
+
PrintPreviewHandler();
virtual ~PrintPreviewHandler();
+ // Get the print preview |data|. The data is valid as long as the
James Hawkins 2011/01/31 18:39:38 s/Get/Gets/
Lei Zhang 2011/01/31 22:15:51 Done.
+ // PrintPreviewHandler is valid and SetPrintPreviewData() does not get called.
+ void GetPrintPreviewData(PrintPreviewData* data);
+
+ // Save the print preview |data|. PrintPreviewHandler owns the data and is
James Hawkins 2011/01/31 18:39:38 s/Save/Saves/ and now that I look at the method na
Lei Zhang 2011/01/31 22:15:51 There's no function named "SetsFoo". Everything in
James Hawkins 2011/02/01 01:02:38 By "this", I was referring to the comment.
+ // responsible for freeing it when either:
+ // a) there is new data.
+ // b) when PrintPreviewHandler goes away.
James Hawkins 2011/01/31 18:39:38 nit: You should probably be more descriptive than
Lei Zhang 2011/01/31 22:15:51 Done.
+ void SetPrintPreviewData(const PrintPreviewData& data);
+
// DOMMessageHandler implementation.
virtual void RegisterMessages();
@@ -34,6 +51,9 @@
// Pointer to current print system.
scoped_refptr<printing::PrintBackend> print_backend_;
+ // Current print preview data, owned by PrintPreviewHandler.
+ PrintPreviewData data_;
+
DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
};
« no previous file with comments | « no previous file | chrome/browser/dom_ui/print_preview_handler.cc » ('j') | chrome/browser/dom_ui/print_preview_ui.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698