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

Side by Side Diff: chrome/browser/printing/print_preview_data_service.h

Issue 7063030: PrintPreview: Print Preview is not staying associated with initiator renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 7 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
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_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
7 #pragma once
8
9 #include <map>
10 #include <string>
11
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/ref_counted_memory.h"
14 #include "chrome/browser/profiles/profile_keyed_service.h"
15
16 // PrintPreviewDataService manages data for chrome://print requests.
17 //
18 // PrintPreviewDataService owns the data and is responsible for freeing it when
19 // either:
20 // a) there is a new data.
21 // b) When PrintPreviewDataService is destroyed.
22 //
23
24 class PrintPreviewDataService : public ProfileKeyedService {
25 public:
26 // 1:1 relationship between PrintPreviewUI and preview data.
27 // Key: Print preview UI address string.
28 // Value: Preview data.
29 typedef std::map<std::string, scoped_refptr<RefCountedBytes> >
30 PreviewDataSourceMap;
Elliot Glaysher 2011/05/27 17:45:50 Why is this public?
kmadhusu 2011/05/27 23:44:42 It can be private. Fixed.
31
32 PrintPreviewDataService();
33
34 // Get the data entry from PreviewDataSrcMap.
35 void GetDataEntry(const std::string& preview_ui_addr_str,
36 scoped_refptr<RefCountedBytes>* data);
37
38 // Set/Update the data entry in PreviewDataSrcMap.
39 void SetDataEntry(const std::string& preview_ui_addr_str,
40 const RefCountedBytes* data);
41
42 // Remove the corresponding PrintPreviewUI entry from the map.
43 void RemoveEntry(const std::string& preview_ui_addr_str);
44
45 private:
46 virtual ~PrintPreviewDataService();
47
48 PreviewDataSourceMap data_src_map_;
49
50 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDataService);
51 };
52
53 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DATA_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698