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

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

Issue 6930034: Print Preview: Print in the background. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix build after r84303 Created 9 years, 8 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
Index: chrome/browser/printing/background_printing_manager.h
===================================================================
--- chrome/browser/printing/background_printing_manager.h (revision 0)
+++ chrome/browser/printing/background_printing_manager.h (revision 0)
@@ -0,0 +1,55 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_
+#define CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_
+#pragma once
+
+#include <set>
+
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "base/threading/non_thread_safe.h"
+#include "content/common/notification_observer.h"
+#include "content/common/notification_registrar.h"
+
+class TabContentsWrapper;
+
+namespace printing {
+
+// Manages hidden tabs that prints documents in the background.
+// The hidden tabs are no longer part of any Browser / TabStripModel.
+// They get deleted when the tab finishes printing.
+class BackgroundPrintingManager
+ : public base::NonThreadSafe,
sky 2011/05/06 16:37:55 Does this class really need to be ref counted? If
Lei Zhang 2011/05/06 18:49:01 No, it doesn't. Removed.
+ public base::RefCountedThreadSafe<BackgroundPrintingManager>,
+ public NotificationObserver {
+ public:
+ BackgroundPrintingManager();
+ ~BackgroundPrintingManager();
+
+ // Hides a TabContentsWrapper.
+ void HideTabContents(TabContentsWrapper* content);
sky 2011/05/06 16:37:55 Did you consider using OwnTabContents? At a minimu
Lei Zhang 2011/05/06 18:49:01 Do you mean renaming this to OwnTabContents? I can
+
+ // Let others iterate over the list of background printing tabs.
+ std::set<TabContentsWrapper*>::const_iterator begin();
+ std::set<TabContentsWrapper*>::const_iterator end();
+
+ // NotificationObserver overrides:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) OVERRIDE;
+
+ private:
+ // The set of tabs managed by BackgroundPrintingManager.
+ std::set<TabContentsWrapper*> printing_contents_;
+
+ NotificationRegistrar registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(BackgroundPrintingManager);
+};
+
+} // namespace printing
+
+#endif // CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_
Property changes on: chrome/browser/printing/background_printing_manager.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698