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

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

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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
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/background_printing_manager.h" 5 #include "chrome/browser/printing/background_printing_manager.h"
6 6
7 #include "chrome/browser/printing/print_job.h" 7 #include "chrome/browser/printing/print_job.h"
8 #include "chrome/browser/printing/print_preview_tab_controller.h" 8 #include "chrome/browser/printing/print_preview_tab_controller.h"
9 #include "chrome/browser/sessions/restore_tab_helper.h" 9 #include "chrome/browser/sessions/restore_tab_helper.h"
10 #include "chrome/browser/tabs/tab_strip_model.h" 10 #include "chrome/browser/tabs/tab_strip_model.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 // Activate the initiator tab. 74 // Activate the initiator tab.
75 PrintPreviewTabController* tab_controller = 75 PrintPreviewTabController* tab_controller =
76 PrintPreviewTabController::GetInstance(); 76 PrintPreviewTabController::GetInstance();
77 if (!tab_controller) 77 if (!tab_controller)
78 return; 78 return;
79 TabContentsWrapper* initiator_tab = 79 TabContentsWrapper* initiator_tab =
80 tab_controller->GetInitiatorTab(preview_tab); 80 tab_controller->GetInitiatorTab(preview_tab);
81 if (!initiator_tab) 81 if (!initiator_tab)
82 return; 82 return;
83 initiator_tab->web_contents()->GetRenderViewHost()->delegate()->Activate(); 83 initiator_tab->web_contents()->GetRenderViewHost()->GetDelegate()->Activate();
84 } 84 }
85 85
86 void BackgroundPrintingManager::Observe( 86 void BackgroundPrintingManager::Observe(
87 int type, 87 int type,
88 const content::NotificationSource& source, 88 const content::NotificationSource& source,
89 const content::NotificationDetails& details) { 89 const content::NotificationDetails& details) {
90 switch (type) { 90 switch (type) {
91 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { 91 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: {
92 OnRendererProcessClosed( 92 OnRendererProcessClosed(
93 content::Source<content::RenderProcessHost>(source).ptr()); 93 content::Source<content::RenderProcessHost>(source).ptr());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 bool BackgroundPrintingManager::HasPrintPreviewTab( 203 bool BackgroundPrintingManager::HasPrintPreviewTab(
204 TabContentsWrapper* preview_tab) { 204 TabContentsWrapper* preview_tab) {
205 if (printing_tabs_.find(preview_tab) != printing_tabs_.end()) 205 if (printing_tabs_.find(preview_tab) != printing_tabs_.end())
206 return true; 206 return true;
207 return printing_tabs_pending_deletion_.find(preview_tab) != 207 return printing_tabs_pending_deletion_.find(preview_tab) !=
208 printing_tabs_pending_deletion_.end(); 208 printing_tabs_pending_deletion_.end();
209 } 209 }
210 210
211 } // namespace printing 211 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/printing/print_dialog_cloud.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698