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

Side by Side 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: '' Created 9 years, 7 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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_
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/printing/background_printing_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698