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

Side by Side Diff: chrome/browser/printing/print_view_manager.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_view_manager.h" 5 #include "chrome/browser/printing/print_view_manager.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 bool PrintViewManager::AdvancedPrintNow() { 96 bool PrintViewManager::AdvancedPrintNow() {
97 PrintPreviewTabController* tab_controller = 97 PrintPreviewTabController* tab_controller =
98 PrintPreviewTabController::GetInstance(); 98 PrintPreviewTabController::GetInstance();
99 if (!tab_controller) 99 if (!tab_controller)
100 return false; 100 return false;
101 TabContentsWrapper* print_preview_tab = 101 TabContentsWrapper* print_preview_tab =
102 tab_controller->GetPrintPreviewForTab(tab_); 102 tab_controller->GetPrintPreviewForTab(tab_);
103 if (print_preview_tab) { 103 if (print_preview_tab) {
104 // Preview tab exist for current tab or current tab is preview tab. 104 // Preview tab exist for current tab or current tab is preview tab.
105 if (!print_preview_tab->web_ui()) 105 if (!print_preview_tab->tab_contents()->web_ui())
106 return false; 106 return false;
107 PrintPreviewUI* print_preview_ui = 107 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>(
108 static_cast<PrintPreviewUI*>(print_preview_tab->web_ui()); 108 print_preview_tab->tab_contents()->web_ui());
109 print_preview_ui->OnShowSystemDialog(); 109 print_preview_ui->OnShowSystemDialog();
110 return true; 110 return true;
111 } else { 111 } else {
112 return PrintNow(); 112 return PrintNow();
113 } 113 }
114 } 114 }
115 115
116 bool PrintViewManager::PrintPreviewNow() { 116 bool PrintViewManager::PrintPreviewNow() {
117 if (print_preview_state_ != NOT_PREVIEWING) { 117 if (print_preview_state_ != NOT_PREVIEWING) {
118 NOTREACHED(); 118 NOTREACHED();
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 } 594 }
595 595
596 bool PrintViewManager::PrintNowInternal(IPC::Message* message) { 596 bool PrintViewManager::PrintNowInternal(IPC::Message* message) {
597 // Don't print / print preview interstitials. 597 // Don't print / print preview interstitials.
598 if (tab_contents()->showing_interstitial_page()) 598 if (tab_contents()->showing_interstitial_page())
599 return false; 599 return false;
600 return Send(message); 600 return Send(message);
601 } 601 }
602 602
603 } // namespace printing 603 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698