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

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

Issue 7550063: Print Preview: Handle a crashed initiator tab by showing a message in PP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review 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/print_preview_tab_controller.h
diff --git a/chrome/browser/printing/print_preview_tab_controller.h b/chrome/browser/printing/print_preview_tab_controller.h
index 6bfc8dcf69408654b69ae1809762ad5a79e21272..d6ea9033cb3f3ff97f4c6ab95590a67f4554b355 100644
--- a/chrome/browser/printing/print_preview_tab_controller.h
+++ b/chrome/browser/printing/print_preview_tab_controller.h
@@ -21,8 +21,13 @@
#include "content/common/notification_registrar.h"
class Browser;
+class RenderProcessHost;
class TabContents;
+namespace content {
+struct LoadCommittedDetails;
+}
+
namespace printing {
class PrintPreviewTabController
@@ -52,7 +57,7 @@ class PrintPreviewTabController
// Returns NULL if no initiator tab exists for |preview_tab|.
TabContents* GetInitiatorTab(TabContents* preview_tab);
- // Notification observer implementation.
+ // NotificationObserver implementation.
virtual void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details);
@@ -66,6 +71,19 @@ class PrintPreviewTabController
private:
friend class base::RefCounted<PrintPreviewTabController>;
+ // 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);
+
+ // Handler for the NAV_ENTRY_COMMITTED notification. This is observed when the
+ // renderer is navigated to a different page.
+ void OnNavEntryCommitted(TabContents* tab,
+ content::LoadCommittedDetails* details);
+
// 1:1 relationship between initiator tab and print preview tab.
// Key: Preview tab.
// Value: Initiator tab.
@@ -78,6 +96,7 @@ class PrintPreviewTabController
void AddObservers(TabContents* tab);
void RemoveObservers(TabContents* tab);
+ // Mapping between print preview tab and the corresponding initiator tab.
PrintPreviewTabMap preview_tab_map_;
// A registrar for listening notifications.

Powered by Google App Engine
This is Rietveld 408576698