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 |