Chromium Code Reviews
|
| 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/memory/ref_counted.h" | |
| 13 #include "base/threading/non_thread_safe.h" | |
| 14 #include "content/common/notification_observer.h" | |
| 15 #include "content/common/notification_registrar.h" | |
| 16 | |
| 17 class TabContentsWrapper; | |
| 18 | |
| 19 namespace printing { | |
| 20 | |
| 21 // Manages hidden tabs that prints documents in the background. | |
| 22 // The hidden tabs are no longer part of any Browser / TabStripModel. | |
| 23 // They get deleted when the tab finishes printing. | |
| 24 class BackgroundPrintingManager | |
| 25 : 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.
| |
| 26 public base::RefCountedThreadSafe<BackgroundPrintingManager>, | |
| 27 public NotificationObserver { | |
| 28 public: | |
| 29 BackgroundPrintingManager(); | |
| 30 ~BackgroundPrintingManager(); | |
| 31 | |
| 32 // Hides a TabContentsWrapper. | |
| 33 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
| |
| 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 |