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

Unified Diff: chrome/browser/printing/background_printing_manager.h

Issue 133013002: Remove render process and WebContents notifications from background printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 6 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/printing/background_printing_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/background_printing_manager.h
diff --git a/chrome/browser/printing/background_printing_manager.h b/chrome/browser/printing/background_printing_manager.h
index 498715287570ea15c5b920803977b9ebe40ffe0d..bb3414ed34d79182d08f0a94c4359020cf2d3940 100644
--- a/chrome/browser/printing/background_printing_manager.h
+++ b/chrome/browser/printing/background_printing_manager.h
@@ -27,7 +27,8 @@ namespace printing {
class BackgroundPrintingManager : public base::NonThreadSafe,
public content::NotificationObserver {
public:
- typedef std::set<content::WebContents*> WebContentsSet;
+ class Observer;
+ typedef std::map<content::WebContents*, Observer*> WebContentsObserverMap;
BackgroundPrintingManager();
virtual ~BackgroundPrintingManager();
@@ -37,12 +38,11 @@ class BackgroundPrintingManager : public base::NonThreadSafe,
// and hides it from the user.
void OwnPrintPreviewDialog(content::WebContents* preview_dialog);
- // Returns true if |printing_contents_set_| contains |preview_dialog|.
+ // Returns true if |printing_contents_map_| contains |preview_dialog|.
bool HasPrintPreviewDialog(content::WebContents* preview_dialog);
- // Let others iterate over the list of background printing contents.
- WebContentsSet::const_iterator begin();
- WebContentsSet::const_iterator end();
+ // Let others see the list of background printing contents.
+ std::set<content::WebContents*> CurrentContentSet();
private:
// content::NotificationObserver overrides:
@@ -50,26 +50,12 @@ class BackgroundPrintingManager : public base::NonThreadSafe,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Notifications handlers.
- void OnRendererProcessClosed(content::RenderProcessHost* rph);
- void OnPrintJobReleased(content::WebContents* preview_contents);
- void OnWebContentsDestroyed(content::WebContents* preview_contents);
-
- // Add |preview_contents| to the pending deletion set and schedule deletion.
+ // Schedule deletion of |preview_contents|.
void DeletePreviewContents(content::WebContents* preview_contents);
- // Check if any of the WebContentses in |set| share a RenderProcessHost
- // with |tab|, excluding |tab|.
- bool HasSharedRenderProcessHost(const WebContentsSet& set,
- content::WebContents* preview_contents);
-
- // The set of print preview WebContentses managed by
- // BackgroundPrintingManager.
- WebContentsSet printing_contents_set_;
-
- // The set of print preview Webcontents managed by BackgroundPrintingManager
- // that are pending deletion.
- WebContentsSet printing_contents_pending_deletion_set_;
+ // A map from print preview WebContentses (managed by
+ // BackgroundPrintingManager) to the Observers that observe them.
+ WebContentsObserverMap printing_contents_map_;
content::NotificationRegistrar registrar_;
« no previous file with comments | « no previous file | chrome/browser/printing/background_printing_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698