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

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

Issue 7574002: Be able to print items that do window.print(); window.close() (airline tix e.g.) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Kausalya's comments. Created 9 years, 4 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
diff --git a/chrome/browser/printing/background_printing_manager.h b/chrome/browser/printing/background_printing_manager.h
index 4d935fa89d8266f91f85ac831706618c7c5ac365..9879eae896dc4e3cbef5bd8f321f673dfd7fb1f4 100644
--- a/chrome/browser/printing/background_printing_manager.h
+++ b/chrome/browser/printing/background_printing_manager.h
@@ -30,24 +30,60 @@ class BackgroundPrintingManager
// Takes ownership of |content| and deletes it when |content| finishes
// printing. This removes the TabContentsWrapper from its TabStrip and
// hides it from the user.
- void OwnTabContents(TabContentsWrapper* content);
+ void OwnPreviewTabContents(TabContentsWrapper* content);
+
+ // Takes ownership of |content| and deletes it when its preview tab is
+ // destroyed by either being canceled, closed or finishing printing. This
+ // removes the TabContentsWrapper from its TabStrip and hides it from the
+ // user.
+ // Returns true if content has an associated print preview tab.
+ bool OwnInitiatorTabContents(TabContentsWrapper* content);
Lei Zhang 2011/08/19 19:00:23 You might want to say it does not take ownership i
Sheridan Rawlins 2011/08/25 22:52:55 Done.
+
+ // Called when we no longer need to access the initiator tab, deletes if
+ // currently owned. Returns true when |content| was owned.
+ bool ReleaseInitiatorTabContents(TabContentsWrapper* content);
// Let others iterate over the list of background printing tabs.
std::set<TabContentsWrapper*>::const_iterator begin();
std::set<TabContentsWrapper*>::const_iterator end();
+ // Let others iterate over the list of background initiator tabs.
Lei Zhang 2011/08/19 19:00:23 are these used anywhere?
Sheridan Rawlins 2011/08/25 22:52:55 No; removed. On 2011/08/19 19:00:23, Lei Zhang wr
+ std::set<TabContentsWrapper*>::const_iterator begin_initiator();
+ std::set<TabContentsWrapper*>::const_iterator end_initiator();
+
// Returns true if |printing_contents_| contains |entry|.
bool HasTabContents(TabContentsWrapper* entry);
+ // Returns true if |initiator_contents_| contains |entry|.
Lei Zhang 2011/08/19 19:00:23 also not used anywhere?
Sheridan Rawlins 2011/08/25 22:52:55 Removed. On 2011/08/19 19:00:23, Lei Zhang wrote:
+ bool HasInitiatorTabContents(TabContentsWrapper* entry);
+
// NotificationObserver overrides:
virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) OVERRIDE;
private:
+ typedef std::set<TabContentsWrapper*> TabContentsWrapperSet;
+
+ // Called when the preview tab is going away to release the corresponding
+ // initiator tab.
+ bool ReleaseInitiatorForPreviewTabContents(
+ TabContentsWrapper* preview_content);
+
+ // Takes ownership of |content| and deletes it when its preview tab is
+ // destroyed by either being canceled, closed or finishing printing. This
+ // removes the TabContentsWrapper from its TabStrip and hides it from the
+ // user.
+ void OwnTabContents(TabContentsWrapper* content,
+ TabContentsWrapper* source_content,
Lei Zhang 2011/08/19 19:00:23 document |source_content|
Sheridan Rawlins 2011/08/25 22:52:55 Done.
+ TabContentsWrapperSet* wrapper_set);
+
// The set of tabs managed by BackgroundPrintingManager.
std::set<TabContentsWrapper*> printing_contents_;
+ // The set of tabs managed by BackgroundPrintingManager.
+ std::set<TabContentsWrapper*> initiator_contents_;
Lei Zhang 2011/08/19 19:00:23 change these to TabContentsWrapperSet since you de
Sheridan Rawlins 2011/08/25 22:52:55 Done.
+
NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(BackgroundPrintingManager);

Powered by Google App Engine
This is Rietveld 408576698