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

Unified Diff: chrome/browser/ui/webui/print_preview_handler.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index ed14480fe865c74fcd8ba73ba3efa7565687eb23..831359a4ecafc5f1871bf0bd17f04b1744ccb34d 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -8,6 +8,7 @@
#include "base/i18n/file_util_icu.h"
#include "base/json/json_reader.h"
+#include "base/memory/ref_counted.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
#include "base/threading/thread.h"
@@ -22,7 +23,6 @@
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "chrome/browser/ui/webui/print_preview_ui_html_source.h"
#include "chrome/browser/ui/webui/print_preview_ui.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/print_messages.h"
@@ -537,16 +537,17 @@ void PrintPreviewHandler::SelectFile(const FilePath& default_filename) {
void PrintPreviewHandler::FileSelected(const FilePath& path,
int index, void* params) {
- PrintPreviewUIHTMLSource::PrintPreviewData data;
PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(web_ui_);
- print_preview_ui->html_source()->GetPrintPreviewData(&data);
- if (!data.first || !data.second) {
+ scoped_refptr<RefCountedBytes> data(new RefCountedBytes());
+ print_preview_ui->GetPrintPreviewData(&data);
+ if (!data->front() || !data->size()) {
NOTREACHED();
return;
}
printing::PreviewMetafile* metafile = new printing::PreviewMetafile;
- metafile->InitFromData(data.first->memory(), data.second);
+ metafile->InitFromData(reinterpret_cast<const void*>(data->front()),
Lei Zhang 2011/05/27 17:26:53 can you static_cast here?
kmadhusu 2011/05/27 23:44:42 Done.
+ data->size());
// Updating last_saved_path_ to the newly selected folder.
*last_saved_path_ = path.DirName();

Powered by Google App Engine
This is Rietveld 408576698