Index: chrome/browser/printing/print_preview_dialog_controller.h |
diff --git a/chrome/browser/printing/print_preview_dialog_controller.h b/chrome/browser/printing/print_preview_dialog_controller.h |
index c89954e5628a6c9c22de206ea17b3c4fd1a3e901..6710e8ec79d536e32959da05a709453fc63054b1 100644 |
--- a/chrome/browser/printing/print_preview_dialog_controller.h |
+++ b/chrome/browser/printing/print_preview_dialog_controller.h |
@@ -44,7 +44,7 @@ class PrintPreviewDialogController |
// Get/Create the print preview dialog for |initiator|. |
// Exposed for unit tests. |
- content::WebContents* GetOrCreatePreviewDialog( |
+ virtual content::WebContents* GetOrCreatePreviewDialog( |
content::WebContents* initiator); |
// Returns the preview dialog for |contents|. |
@@ -79,8 +79,9 @@ class PrintPreviewDialogController |
return is_creating_print_preview_dialog_; |
} |
- private: |
- friend class base::RefCounted<PrintPreviewDialogController>; |
+ protected: |
+ // Moved to this category so that testing subclass works |
Lei Zhang
2016/08/17 21:27:54
No need for the comment in the code to check in. M
|
+ ~PrintPreviewDialogController() override; |
// 1:1 relationship between a print preview dialog and its initiator tab. |
// Key: Print preview dialog. |
@@ -88,8 +89,16 @@ class PrintPreviewDialogController |
using PrintPreviewDialogMap = |
std::map<content::WebContents*, content::WebContents*>; |
- ~PrintPreviewDialogController() override; |
+ // Mapping between print preview dialog and the corresponding initiator. |
+ PrintPreviewDialogMap preview_dialog_map_; |
Lei Zhang
2016/08/17 21:27:54
Can we provide a setter method instead? Keep the m
|
+ virtual void RemoveInitiator(content::WebContents* initiator); |
+ |
+ // Adds/removes observers for notifications from |contents|. |
+ void AddObservers(content::WebContents* contents); |
+ void RemoveObservers(content::WebContents* contents); |
+ private: |
+ friend class base::RefCounted<PrintPreviewDialogController>; |
// Handler for the RENDERER_PROCESS_CLOSED notification. This is observed when |
// the initiator renderer crashed. |
void OnRendererProcessClosed(content::RenderProcessHost* rph); |
@@ -111,17 +120,9 @@ class PrintPreviewDialogController |
// |preview_dialog| in |preview_dialog|'s PrintPreviewUI. |
void SaveInitiatorTitle(content::WebContents* preview_dialog); |
- // Adds/Removes observers for notifications from |contents|. |
- void AddObservers(content::WebContents* contents); |
- void RemoveObservers(content::WebContents* contents); |
- |
// Removes WebContents when they close/crash/navigate. |
- void RemoveInitiator(content::WebContents* initiator); |
void RemovePreviewDialog(content::WebContents* preview_dialog); |
- // Mapping between print preview dialog and the corresponding initiator. |
- PrintPreviewDialogMap preview_dialog_map_; |
- |
// A registrar for listening to notifications. |
content::NotificationRegistrar registrar_; |