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

Unified Diff: chrome/browser/dom_ui/print_preview_ui_html_source.h

Issue 6334010: Print Preview: Store preview data in the print preview handler.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase 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_ui_html_source.h
===================================================================
--- chrome/browser/dom_ui/print_preview_ui_html_source.h (revision 0)
+++ chrome/browser/dom_ui/print_preview_ui_html_source.h (revision 0)
@@ -0,0 +1,50 @@
+// 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_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
+#define CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
+#pragma once
+
+#include <string>
+#include <utility>
+
+#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
+
+namespace base {
+class SharedMemory;
+}
+
+class PrintPreviewUIHTMLSource : public ChromeURLDataManager::DataSource {
+ public:
+ // A SharedMemory that contains the data for print preview,
+ // and the size of the print preview data in bytes.
+ typedef std::pair<base::SharedMemory*, uint32> PrintPreviewData;
+
+ explicit PrintPreviewUIHTMLSource();
James Hawkins 2011/02/03 00:53:52 explicit should only be used for constructors with
Lei Zhang 2011/02/03 02:19:32 Fixed.
+ virtual ~PrintPreviewUIHTMLSource();
+
+ // Gets the print preview |data|. The data is valid as long as the
+ // PrintPreviewHandler is valid and SetPrintPreviewData() does not get called.
+ void GetPrintPreviewData(PrintPreviewData* data);
+
+ // Sets the print preview |data|. PrintPreviewHandler owns the data and is
+ // responsible for freeing it when either:
+ // a) there is new data.
+ // b) when PrintPreviewHandler is destroyed.
+ void SetPrintPreviewData(const PrintPreviewData& data);
+
+ // ChromeURLDataManager::DataSource implementation.
+ virtual void StartDataRequest(const std::string& path,
+ bool is_off_the_record,
+ int request_id);
+ virtual std::string GetMimeType(const std::string&) const;
+
+ private:
+ // Current print preview data, owned by PrintPreviewHandler.
James Hawkins 2011/02/03 00:53:52 nit: It would be more appropriate to state, "the c
Lei Zhang 2011/02/03 02:19:32 Done.
+ PrintPreviewData data_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintPreviewUIHTMLSource);
+};
+
+#endif // CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
Property changes on: chrome/browser/dom_ui/print_preview_ui_html_source.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698