#ifndef CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_
#define CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_
#include <map>
#include <set>
#include "base/compiler_specific.h"
#include "base/threading/non_thread_safe.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
namespace content {
class RenderProcessHost;
class WebContents;
}
namespace printing {
class BackgroundPrintingManager : public base::NonThreadSafe,
public content::NotificationObserver {
public:
class Observer;
typedef std::map<content::WebContents*, Observer*> WebContentsObserverMap;
BackgroundPrintingManager();
virtual ~BackgroundPrintingManager();
void OwnPrintPreviewDialog(content::WebContents* preview_dialog);
bool HasPrintPreviewDialog(content::WebContents* preview_dialog);
std::set<content::WebContents*> CurrentContentSet();
private:
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
void DeletePreviewContents(content::WebContents* preview_contents);
WebContentsObserverMap printing_contents_map_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(BackgroundPrintingManager);
};
}
#endif