| Index: chrome/browser/printing/print_preview_message_handler.cc
|
| ===================================================================
|
| --- chrome/browser/printing/print_preview_message_handler.cc (revision 116331)
|
| +++ chrome/browser/printing/print_preview_message_handler.cc (working copy)
|
| @@ -19,13 +19,14 @@
|
| #include "chrome/browser/ui/webui/print_preview_ui.h"
|
| #include "chrome/common/print_messages.h"
|
| #include "content/browser/renderer_host/render_view_host.h"
|
| -#include "content/browser/tab_contents/tab_contents.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/web_contents.h"
|
| #include "printing/page_size_margins.h"
|
| #include "printing/print_job_constants.h"
|
|
|
| using content::BrowserThread;
|
| using content::NavigationController;
|
| +using content::WebContents;
|
|
|
| namespace {
|
|
|
| @@ -64,9 +65,9 @@
|
| namespace printing {
|
|
|
| PrintPreviewMessageHandler::PrintPreviewMessageHandler(
|
| - TabContents* tab_contents)
|
| - : content::WebContentsObserver(tab_contents) {
|
| - DCHECK(tab_contents);
|
| + WebContents* web_contents)
|
| + : content::WebContentsObserver(web_contents) {
|
| + DCHECK(web_contents);
|
| }
|
|
|
| PrintPreviewMessageHandler::~PrintPreviewMessageHandler() {
|
| @@ -92,11 +93,11 @@
|
| // Inform the print preview tab of the failure.
|
| TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
|
| // User might have closed it already.
|
| - if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
|
| + if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
|
| return NULL;
|
|
|
| return static_cast<PrintPreviewUI*>(
|
| - print_preview_tab->tab_contents()->GetWebUI());
|
| + print_preview_tab->web_contents()->GetWebUI());
|
| }
|
|
|
| void PrintPreviewMessageHandler::OnRequestPrintPreview(
|
| @@ -114,11 +115,11 @@
|
| }
|
|
|
| TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
|
| - if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
|
| + if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
|
| return;
|
|
|
| PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
|
| - print_preview_tab->tab_contents()->GetWebUI());
|
| + print_preview_tab->web_contents()->GetWebUI());
|
|
|
| if (!params.is_modifiable || params.clear_preview_data)
|
| print_preview_ui->ClearAllPreviewData();
|
| @@ -129,11 +130,11 @@
|
| void PrintPreviewMessageHandler::OnDidPreviewPage(
|
| const PrintHostMsg_DidPreviewPage_Params& params) {
|
| TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
|
| - if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
|
| + if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
|
| return;
|
|
|
| PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
|
| - print_preview_tab->tab_contents()->GetWebUI());
|
| + print_preview_tab->web_contents()->GetWebUI());
|
| int page_number = params.page_number;
|
| if (page_number >= FIRST_PAGE_INDEX && params.data_size) {
|
| RefCountedBytes* data_bytes =
|
| @@ -158,11 +159,11 @@
|
| // Get the print preview tab.
|
| TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
|
| // User might have closed it already.
|
| - if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
|
| + if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
|
| return;
|
|
|
| PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
|
| - print_preview_tab->tab_contents()->GetWebUI());
|
| + print_preview_tab->web_contents()->GetWebUI());
|
|
|
| if (params.reuse_existing_data) {
|
| // Need to match normal rendering where we are expected to send this.
|
| @@ -200,11 +201,11 @@
|
| void PrintPreviewMessageHandler::OnDidGetDefaultPageLayout(
|
| const PageSizeMargins& page_layout_in_points) {
|
| TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
|
| - if (!print_preview_tab || !print_preview_tab->tab_contents()->GetWebUI())
|
| + if (!print_preview_tab || !print_preview_tab->web_contents()->GetWebUI())
|
| return;
|
|
|
| PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
|
| - print_preview_tab->tab_contents()->GetWebUI());
|
| + print_preview_tab->web_contents()->GetWebUI());
|
| print_preview_ui->OnDidGetDefaultPageLayout(page_layout_in_points);
|
| }
|
|
|
|
|