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

Side by Side Diff: chrome/browser/ui/webui/print_preview_data_manager.cc

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 #include "chrome/browser/ui/webui/print_preview_data_source.h"
6
7 #include <vector>
sky 2011/05/26 17:40:41 nuke this include.
kmadhusu 2011/05/27 16:49:22 Done.
8
9 #include "base/shared_memory.h"
10 #include "chrome/browser/ui/webui/print_preview_ui.h"
11
12 PrintPreviewDataManager::PrintPreviewDataManager() {
13 }
14
15 PrintPreviewDataManager::~PrintPreviewDataManager() {
16 }
sky 2011/05/26 17:40:41 If you don't convert to RefCountedBytes, then this
kmadhusu 2011/05/27 16:49:22 Fixed. Modified code to store the RefCountedBytes
17
18 void PrintPreviewDataManager::GetDataEntry(
19 const std::string& preview_ui_addr_str, PrintPreviewData* data) {
20 PreviewDataSrcMap::iterator it = data_source_map_.find(preview_ui_addr_str);
21 if (it != data_source_map_.end())
22 *data = data_source_map_[preview_ui_addr_str];
23 }
24
25 void PrintPreviewDataManager::SetDataEntry(
26 const std::string& preview_ui_addr_str, const PrintPreviewData& data) {
27 RemoveEntry(preview_ui_addr_str);
28 data_source_map_[preview_ui_addr_str] = data;
29 }
30
31 void PrintPreviewDataManager::RemoveEntry(
32 const std::string& preview_ui_addr_str) {
33 PreviewDataSrcMap::iterator it = data_source_map_.find(preview_ui_addr_str);
34 if (it == data_source_map_.end())
35 return;
36
37 if (it->second.first)
38 delete it->second.first;
39 data_source_map_.erase(it);
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698