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

Unified Diff: chrome/browser/printing/printing_message_filter.cc

Issue 10388214: Make cloud print dialog creation function not use browser list, instead obtain profile and parent w… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/printing/printing_message_filter.cc
===================================================================
--- chrome/browser/printing/printing_message_filter.cc (revision 138829)
+++ chrome/browser/printing/printing_message_filter.cc (working copy)
@@ -22,6 +22,9 @@
#include "base/file_util.h"
#include "base/lazy_instance.h"
#include "chrome/browser/printing/print_dialog_cloud.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
#endif
using content::BrowserThread;
@@ -76,8 +79,9 @@
} // namespace
-PrintingMessageFilter::PrintingMessageFilter()
- : print_job_manager_(g_browser_process->print_job_manager()) {
+PrintingMessageFilter::PrintingMessageFilter(int render_process_id)
+ : print_job_manager_(g_browser_process->print_job_manager()),
+ render_process_id_(render_process_id) {
}
PrintingMessageFilter::~PrintingMessageFilter() {
@@ -155,7 +159,8 @@
}
}
-void PrintingMessageFilter::OnTempFileForPrintingWritten(int sequence_number) {
+void PrintingMessageFilter::OnTempFileForPrintingWritten(int render_view_id,
+ int sequence_number) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
SequenceToPathMap* map = &g_printing_file_descriptor_map.Get().map;
SequenceToPathMap::iterator it = map->find(sequence_number);
@@ -165,12 +170,16 @@
return;
}
+ content::RenderViewHost* view = content::RenderViewHost::FromID(
+ render_process_id_, render_view_id);
+ content::WebContents* wc = content::WebContents::FromRenderViewHost(view);
print_dialog_cloud::CreatePrintDialogForFile(
+ wc->GetBrowserContext(),
+ wc->GetView()->GetTopLevelNativeWindow(),
it->second,
string16(),
string16(),
std::string("application/pdf"),
- true,
false);
// Erase the entry in the map.
« no previous file with comments | « chrome/browser/printing/printing_message_filter.h ('k') | chrome/browser/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698