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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 2510753002: Revert of Make printing work better with OOPIF. (Closed)
Patch Set: Created 4 years, 1 month 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/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 40d510c6c19eb31acb71e54d3089810de0e2cb7c..bc5bd03fe62ce0aaa8f28ec1d7cc3027ea6ac25e 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -72,8 +72,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
-#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "google_apis/gaia/oauth2_token_service.h"
@@ -101,7 +101,7 @@
#endif
using content::BrowserThread;
-using content::RenderFrameHost;
+using content::RenderViewHost;
using content::WebContents;
using printing::PrintViewManager;
@@ -701,11 +701,7 @@
++regenerate_preview_request_count_;
WebContents* initiator = GetInitiator();
- content::RenderFrameHost* rfh =
- initiator
- ? PrintViewManager::FromWebContents(initiator)->print_preview_rfh()
- : nullptr;
- if (!rfh) {
+ if (!initiator) {
ReportUserActionHistogram(INITIATOR_CLOSED);
print_preview_ui()->OnClosePrintPreviewDialog();
return;
@@ -763,7 +759,8 @@
NOTREACHED();
}
- rfh->Send(new PrintMsg_PrintPreview(rfh->GetRoutingID(), *settings));
+ RenderViewHost* rvh = initiator->GetRenderViewHost();
+ rvh->Send(new PrintMsg_PrintPreview(rvh->GetRoutingID(), *settings));
}
void PrintPreviewHandler::HandlePrint(const base::ListValue* args) {
@@ -929,9 +926,9 @@
// Set ID to know whether printing is for preview.
settings->SetInteger(printing::kPreviewUIID,
print_preview_ui()->GetIDForPrintPreviewUI());
- RenderFrameHost* rfh = preview_web_contents()->GetMainFrame();
- rfh->Send(
- new PrintMsg_PrintForPrintPreview(rfh->GetRoutingID(), *settings));
+ RenderViewHost* rvh = preview_web_contents()->GetRenderViewHost();
+ rvh->Send(new PrintMsg_PrintForPrintPreview(rvh->GetRoutingID(),
+ *settings));
// For all other cases above, the preview dialog will stay open until the
// printing has finished. Then the dialog closes and PrintPreviewDone() gets

Powered by Google App Engine
This is Rietveld 408576698