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

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
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ff8c16c2c9c3dc0e09d23b1272f44b9e78a17e42..70b2b48f1db514d31e5a042a8150db22bdbbee74 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"
@@ -619,16 +619,16 @@ 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()) {
NOTREACHED();
return;
}
printing::PreviewMetafile* metafile = new printing::PreviewMetafile;
- metafile->InitFromData(data.first->memory(), data.second);
+ metafile->InitFromData(static_cast<const void*>(data->front()), data->size());
// Updating last_saved_path_ to the newly selected folder.
*last_saved_path_ = path.DirName();
« no previous file with comments | « chrome/browser/ui/webui/print_preview_data_source.cc ('k') | chrome/browser/ui/webui/print_preview_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698