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

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

Issue 10911351: Switch PrintViewManager, PrintPreviewMessageHandler to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix typo Created 8 years, 3 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/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 5d6287eca84272514dbf41e2a17d3c8ccc6a4061..a861023fd5b1dcfe87152f110f74fec60b21d3e7 100644
--- a/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chrome/browser/printing/print_preview_message_handler.cc
@@ -28,6 +28,8 @@
using content::BrowserThread;
using content::WebContents;
+int printing::PrintPreviewMessageHandler::kUserDataKey;
+
namespace {
void StopWorker(int document_cookie) {
@@ -79,11 +81,8 @@ TabContents* PrintPreviewMessageHandler::GetPrintPreviewTab() {
if (!tab_controller)
return NULL;
- return tab_controller->GetPrintPreviewForTab(tab_contents());
-}
-
-TabContents* PrintPreviewMessageHandler::tab_contents() {
- return TabContents::FromWebContents(web_contents());
+ return tab_controller->GetPrintPreviewForTab(
+ TabContents::FromWebContents(web_contents()));
}
PrintPreviewUI* PrintPreviewMessageHandler::GetPrintPreviewUI() {
@@ -96,10 +95,12 @@ PrintPreviewUI* PrintPreviewMessageHandler::GetPrintPreviewUI() {
void PrintPreviewMessageHandler::OnRequestPrintPreview(
bool source_is_modifiable, bool webnode_only) {
- TabContents* tab = tab_contents();
- if (webnode_only)
- tab->print_view_manager()->PrintPreviewForWebNode();
- PrintPreviewTabController::PrintPreview(tab);
+ if (webnode_only) {
+ printing::PrintViewManager::FromWebContents(web_contents())->
+ PrintPreviewForWebNode();
+ }
+ PrintPreviewTabController::PrintPreview(
+ TabContents::FromWebContents(web_contents()));
PrintPreviewUI::SetSourceIsModifiable(GetPrintPreviewTab(),
source_is_modifiable);
}
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.h ('k') | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698