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

Side by Side Diff: chrome/browser/printing/print_preview_message_handler.cc

Issue 10538059: TabContentsWrapper -> TabContents, part 24. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_preview_message_handler.h" 5 #include "chrome/browser/printing/print_preview_message_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 TabContents* PrintPreviewMessageHandler::GetPrintPreviewTab() { 77 TabContents* PrintPreviewMessageHandler::GetPrintPreviewTab() {
78 PrintPreviewTabController* tab_controller = 78 PrintPreviewTabController* tab_controller =
79 PrintPreviewTabController::GetInstance(); 79 PrintPreviewTabController::GetInstance();
80 if (!tab_controller) 80 if (!tab_controller)
81 return NULL; 81 return NULL;
82 82
83 return tab_controller->GetPrintPreviewForTab(tab_contents()); 83 return tab_controller->GetPrintPreviewForTab(tab_contents());
84 } 84 }
85 85
86 TabContents* PrintPreviewMessageHandler::tab_contents() { 86 TabContents* PrintPreviewMessageHandler::tab_contents() {
87 return TabContents::GetCurrentWrapperForContents(web_contents()); 87 return TabContents::FromWebContents(web_contents());
88 } 88 }
89 89
90 PrintPreviewUI* PrintPreviewMessageHandler::GetPrintPreviewUI() { 90 PrintPreviewUI* PrintPreviewMessageHandler::GetPrintPreviewUI() {
91 TabContents* tab = GetPrintPreviewTab(); 91 TabContents* tab = GetPrintPreviewTab();
92 if (!tab || !tab->web_contents()->GetWebUI()) 92 if (!tab || !tab->web_contents()->GetWebUI())
93 return NULL; 93 return NULL;
94 return static_cast<PrintPreviewUI*>( 94 return static_cast<PrintPreviewUI*>(
95 tab->web_contents()->GetWebUI()->GetController()); 95 tab->web_contents()->GetWebUI()->GetController());
96 } 96 }
97 97
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return; 260 return;
261 } 261 }
262 // If |tab| is navigating and it has a print preview tab, notify |tab| to 262 // If |tab| is navigating and it has a print preview tab, notify |tab| to
263 // consider print preview done so it unfreezes the renderer in the case of 263 // consider print preview done so it unfreezes the renderer in the case of
264 // window.print(). 264 // window.print().
265 if (preview_tab) 265 if (preview_tab)
266 tab->print_view_manager()->PrintPreviewDone(); 266 tab->print_view_manager()->PrintPreviewDone();
267 } 267 }
268 268
269 } // namespace printing 269 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698