Chromium Code Reviews| 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..bef455b3f82b8fe87a85c6923f18d0ece5cbd7a0 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(); |
| @@ -40,9 +41,10 @@ class BackgroundPrintingManager : public base::NonThreadSafe, |
| // Returns true if |printing_contents_set_| contains |preview_dialog|. |
|
Lei Zhang
2014/01/11 02:35:22
|printing_contents_set_| -> |printing_contents_map
Avi (use Gerrit)
2014/01/11 19:12:49
Done.
|
| 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(); |
| + // WebContentsSet::const_iterator begin(); |
|
Lei Zhang
2014/01/11 02:35:22
remove commented out code?
Avi (use Gerrit)
2014/01/11 19:12:49
Oops, yeah.
|
| + // WebContentsSet::const_iterator end(); |
| private: |
| // content::NotificationObserver overrides: |
| @@ -50,26 +52,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_; |