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

Unified Diff: chrome/browser/ui/browser_commands.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/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index 9c31248f60e98362f8ad700a218d867416b243d3..d09a5e2e9996a9dbccc227b049281e611a81ac25 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -681,13 +681,14 @@ void ShareCurrentPage(Browser* browser) {
}
void Print(Browser* browser) {
+ printing::PrintViewManager* print_view_manager =
+ printing::PrintViewManager::FromWebContents(
+ GetActiveWebContents(browser));
if (browser->profile()->GetPrefs()->GetBoolean(
- prefs::kPrintPreviewDisabled)) {
- GetActiveTabContents(browser)->print_view_manager()->PrintNow();
- } else {
- GetActiveTabContents(browser)->print_view_manager()->
- PrintPreviewNow();
- }
+ prefs::kPrintPreviewDisabled))
+ print_view_manager->PrintNow();
+ else
+ print_view_manager->PrintPreviewNow();
}
bool CanPrint(const Browser* browser) {
@@ -701,8 +702,10 @@ bool CanPrint(const Browser* browser) {
}
void AdvancedPrint(Browser* browser) {
- GetActiveTabContents(browser)->print_view_manager()->
- AdvancedPrintNow();
+ printing::PrintViewManager* print_view_manager =
+ printing::PrintViewManager::FromWebContents(
+ GetActiveWebContents(browser));
+ print_view_manager->AdvancedPrintNow();
}
bool CanAdvancedPrint(const Browser* browser) {
@@ -713,7 +716,10 @@ bool CanAdvancedPrint(const Browser* browser) {
}
void PrintToDestination(Browser* browser) {
- GetActiveTabContents(browser)->print_view_manager()->PrintToDestination();
+ printing::PrintViewManager* print_view_manager =
+ printing::PrintViewManager::FromWebContents(
+ GetActiveWebContents(browser));
+ print_view_manager->PrintToDestination();
}
void EmailPageLocation(Browser* browser) {

Powered by Google App Engine
This is Rietveld 408576698