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

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

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/print_preview_message_handler.cc
diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
index 50770adc8fa07ee45c185a4c9abcbc02d803e7b1..7a0470afa395672875e769b3065ef2946a3761e5 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -91,10 +91,11 @@ PrintPreviewUI* PrintPreviewMessageHandler::OnFailure(int document_cookie) {
// 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->web_ui())
+ if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui())
return NULL;
- return static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ return static_cast<PrintPreviewUI*>(
+ print_preview_tab->tab_contents()->web_ui());
}
void PrintPreviewMessageHandler::OnRequestPrintPreview(
@@ -112,11 +113,11 @@ void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
}
TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
- if (!print_preview_tab || !print_preview_tab->web_ui())
+ if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui())
return;
PrintPreviewUI* print_preview_ui =
- static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui());
if (!params.is_modifiable || params.clear_preview_data)
print_preview_ui->ClearAllPreviewData();
@@ -127,11 +128,11 @@ void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
void PrintPreviewMessageHandler::OnDidPreviewPage(
const PrintHostMsg_DidPreviewPage_Params& params) {
TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
- if (!print_preview_tab || !print_preview_tab->web_ui())
+ if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui())
return;
PrintPreviewUI* print_preview_ui =
- static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui());
int page_number = params.page_number;
if (page_number >= FIRST_PAGE_INDEX && params.data_size) {
RefCountedBytes* data_bytes =
@@ -156,11 +157,11 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
// Get the print preview tab.
TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
// User might have closed it already.
- if (!print_preview_tab || !print_preview_tab->web_ui())
+ if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui())
return;
PrintPreviewUI* print_preview_ui =
- static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui());
if (params.reuse_existing_data) {
// Need to match normal rendering where we are expected to send this.
@@ -198,11 +199,11 @@ void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie) {
void PrintPreviewMessageHandler::OnDidGetDefaultPageLayout(
const PageSizeMargins& page_layout_in_points) {
TabContentsWrapper* print_preview_tab = GetPrintPreviewTab();
- if (!print_preview_tab || !print_preview_tab->web_ui())
+ if (!print_preview_tab || !print_preview_tab->tab_contents()->web_ui())
return;
PrintPreviewUI* print_preview_ui =
- static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ static_cast<PrintPreviewUI*>(print_preview_tab->tab_contents()->web_ui());
print_preview_ui->OnDidGetDefaultPageLayout(page_layout_in_points);
}
« no previous file with comments | « chrome/browser/printing/background_printing_manager.cc ('k') | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698