| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <set> |
| 10 |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/threading/non_thread_safe.h" |
| 13 #include "content/common/notification_observer.h" |
| 14 #include "content/common/notification_registrar.h" |
| 15 |
| 16 class TabContentsWrapper; |
| 17 |
| 18 namespace printing { |
| 19 |
| 20 // Manages hidden tabs that prints documents in the background. |
| 21 // The hidden tabs are no longer part of any Browser / TabStripModel. |
| 22 // They get deleted when the tab finishes printing. |
| 23 class BackgroundPrintingManager |
| 24 : public base::NonThreadSafe, |
| 25 public NotificationObserver { |
| 26 public: |
| 27 BackgroundPrintingManager(); |
| 28 virtual ~BackgroundPrintingManager(); |
| 29 |
| 30 // Takes ownership of |content| and deletes it when |content| finishes |
| 31 // printing. This removes the TabContentsWrapper from its TabStrip and |
| 32 // hides it from the user. |
| 33 void OwnTabContents(TabContentsWrapper* content); |
| 34 |
| 35 // Let others iterate over the list of background printing tabs. |
| 36 std::set<TabContentsWrapper*>::const_iterator begin(); |
| 37 std::set<TabContentsWrapper*>::const_iterator end(); |
| 38 |
| 39 // NotificationObserver overrides: |
| 40 virtual void Observe(NotificationType type, |
| 41 const NotificationSource& source, |
| 42 const NotificationDetails& details) OVERRIDE; |
| 43 |
| 44 private: |
| 45 // The set of tabs managed by BackgroundPrintingManager. |
| 46 std::set<TabContentsWrapper*> printing_contents_; |
| 47 |
| 48 NotificationRegistrar registrar_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(BackgroundPrintingManager); |
| 51 }; |
| 52 |
| 53 } // namespace printing |
| 54 |
| 55 #endif // CHROME_BROWSER_PRINTING_BACKGROUND_PRINTING_MANAGER_H_ |
| OLD | NEW |