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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
6 #define CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
7 #pragma once
8
9 #include <string>
10 #include <utility>
11
12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
13
14 namespace base {
15 class SharedMemory;
16 }
17
18 class PrintPreviewUIHTMLSource : public ChromeURLDataManager::DataSource {
19 public:
20 // A SharedMemory that contains the data for print preview,
21 // and the size of the print preview data in bytes.
22 typedef std::pair<base::SharedMemory*, uint32> PrintPreviewData;
23
24 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.
25 virtual ~PrintPreviewUIHTMLSource();
26
27 // Gets the print preview |data|. The data is valid as long as the
28 // PrintPreviewHandler is valid and SetPrintPreviewData() does not get called.
29 void GetPrintPreviewData(PrintPreviewData* data);
30
31 // Sets the print preview |data|. PrintPreviewHandler owns the data and is
32 // responsible for freeing it when either:
33 // a) there is new data.
34 // b) when PrintPreviewHandler is destroyed.
35 void SetPrintPreviewData(const PrintPreviewData& data);
36
37 // ChromeURLDataManager::DataSource implementation.
38 virtual void StartDataRequest(const std::string& path,
39 bool is_off_the_record,
40 int request_id);
41 virtual std::string GetMimeType(const std::string&) const;
42
43 private:
44 // 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.
45 PrintPreviewData data_;
46
47 DISALLOW_COPY_AND_ASSIGN(PrintPreviewUIHTMLSource);
48 };
49
50 #endif // CHROME_BROWSER_DOM_UI_PRINT_PREVIEW_UI_HTML_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698