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

Side by Side Diff: chrome/browser/printing/print_preview_data_service.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/printing/print_preview_data_service.h"
6
7 PrintPreviewDataService::PrintPreviewDataService() {
8 }
9
10 PrintPreviewDataService::~PrintPreviewDataService() {
11 }
12
13 void PrintPreviewDataService::GetDataEntry(
14 const std::string& preview_ui_addr_str,
15 scoped_refptr<RefCountedBytes>* data_bytes) {
16 PreviewDataSourceMap::iterator it = data_src_map_.find(preview_ui_addr_str);
17 if (it != data_src_map_.end())
18 *data_bytes = it->second.get();
19 }
20
21 void PrintPreviewDataService::SetDataEntry(
22 const std::string& preview_ui_addr_str, const RefCountedBytes* data_bytes) {
23 RemoveEntry(preview_ui_addr_str);
24 data_src_map_[preview_ui_addr_str] = const_cast<RefCountedBytes*>(data_bytes);
25 }
26
27 void PrintPreviewDataService::RemoveEntry(
28 const std::string& preview_ui_addr_str) {
29 PreviewDataSourceMap::iterator it = data_src_map_.find(preview_ui_addr_str);
30 if (it != data_src_map_.end())
31 data_src_map_.erase(it);
32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698