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

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

Issue 7790020: Cleanup: Convert PrintPreviewTabController to use TabContentsWrapper. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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/print_preview_tab_controller.h
===================================================================
--- chrome/browser/printing/print_preview_tab_controller.h (revision 98744)
+++ chrome/browser/printing/print_preview_tab_controller.h (working copy)
@@ -22,7 +22,7 @@
class Browser;
class RenderProcessHost;
-class TabContents;
+class TabContentsWrapper;
namespace content {
struct LoadCommittedDetails;
@@ -42,20 +42,20 @@
// Initiate print preview for |initiator_tab|.
// Call this instead of GetOrCreatePreviewTab().
- static void PrintPreview(TabContents* initiator_tab);
+ static void PrintPreview(TabContentsWrapper* initiator_tab);
// Get/Create the print preview tab for |initiator_tab|.
// Exposed for unit tests.
- TabContents* GetOrCreatePreviewTab(TabContents* initiator_tab);
+ TabContentsWrapper* GetOrCreatePreviewTab(TabContentsWrapper* initiator_tab);
// Returns preview tab for |tab|.
// Returns |tab| if |tab| is a preview tab.
// Returns NULL if no preview tab exists for |tab|.
- TabContents* GetPrintPreviewForTab(TabContents* tab) const;
+ TabContentsWrapper* GetPrintPreviewForTab(TabContentsWrapper* tab) const;
// Returns initiator tab for |preview_tab|.
// Returns NULL if no initiator tab exists for |preview_tab|.
- TabContents* GetInitiatorTab(TabContents* preview_tab);
+ TabContentsWrapper* GetInitiatorTab(TabContentsWrapper* preview_tab);
// NotificationObserver implementation.
virtual void Observe(int type,
@@ -63,42 +63,42 @@
const NotificationDetails& details);
// Returns true if |tab| is a print preview tab.
- static bool IsPrintPreviewTab(TabContents* tab);
+ static bool IsPrintPreviewTab(TabContentsWrapper* tab);
// Erase the initiator tab info associated with |preview_tab|.
- void EraseInitiatorTabInfo(TabContents* preview_tab);
+ void EraseInitiatorTabInfo(TabContentsWrapper* preview_tab);
private:
friend class base::RefCounted<PrintPreviewTabController>;
+ // 1:1 relationship between initiator tab and print preview tab.
+ // Key: Preview tab.
+ // Value: Initiator tab.
+ typedef std::map<TabContentsWrapper*, TabContentsWrapper*> PrintPreviewTabMap;
+
// Handler for the RENDERER_PROCESS_CLOSED notification. This is observed when
// the initiator renderer crashed.
void OnRendererProcessClosed(RenderProcessHost* rph);
// Handler for the TAB_CONTENTS_DESTROYED notification. This is observed when
// either tab is closed.
- void OnTabContentsDestroyed(TabContents* tab);
+ void OnTabContentsDestroyed(TabContentsWrapper* tab);
// Handler for the NAV_ENTRY_COMMITTED notification. This is observed when the
// renderer is navigated to a different page.
- void OnNavEntryCommitted(TabContents* tab,
+ void OnNavEntryCommitted(TabContentsWrapper* tab,
content::LoadCommittedDetails* details);
- // 1:1 relationship between initiator tab and print preview tab.
- // Key: Preview tab.
- // Value: Initiator tab.
- typedef std::map<TabContents*, TabContents*> PrintPreviewTabMap;
-
// Creates a new print preview tab.
- TabContents* CreatePrintPreviewTab(TabContents* initiator_tab);
+ TabContentsWrapper* CreatePrintPreviewTab(TabContentsWrapper* initiator_tab);
// Helper function to store the initiator tab(title and url) information
- // in |PrintPreviewUI|.
- void SetInitiatorTabURLAndTitle(TabContents* preview_tab);
+ // in PrintPreviewUI.
+ void SetInitiatorTabURLAndTitle(TabContentsWrapper* preview_tab);
// Adds/Removes observers for notifications from |tab|.
- void AddObservers(TabContents* tab);
- void RemoveObservers(TabContents* tab);
+ void AddObservers(TabContentsWrapper* tab);
+ void RemoveObservers(TabContentsWrapper* tab);
// Mapping between print preview tab and the corresponding initiator tab.
PrintPreviewTabMap preview_tab_map_;

Powered by Google App Engine
This is Rietveld 408576698