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

Side by Side Diff: chrome/browser/printing/print_preview_dialog_controller.h

Issue 668093002: Standardize usage of virtual/override/final in chrome/browser/printing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_
6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_ 6 #define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Returns the initiator for |preview_dialog|. 56 // Returns the initiator for |preview_dialog|.
57 // Returns NULL if no initiator exists for |preview_dialog|. 57 // Returns NULL if no initiator exists for |preview_dialog|.
58 content::WebContents* GetInitiator(content::WebContents* preview_dialog); 58 content::WebContents* GetInitiator(content::WebContents* preview_dialog);
59 59
60 // Run |callback| on the dialog of each active print preview operation. 60 // Run |callback| on the dialog of each active print preview operation.
61 void ForEachPreviewDialog( 61 void ForEachPreviewDialog(
62 base::Callback<void(content::WebContents*)> callback); 62 base::Callback<void(content::WebContents*)> callback);
63 63
64 // content::NotificationObserver implementation. 64 // content::NotificationObserver implementation.
65 virtual void Observe(int type, 65 void Observe(int type,
66 const content::NotificationSource& source, 66 const content::NotificationSource& source,
67 const content::NotificationDetails& details) override; 67 const content::NotificationDetails& details) override;
68 68
69 // Returns true if |contents| is a print preview dialog. 69 // Returns true if |contents| is a print preview dialog.
70 static bool IsPrintPreviewDialog(content::WebContents* contents); 70 static bool IsPrintPreviewDialog(content::WebContents* contents);
71 71
72 // Returns true if |url| is a print preview url. 72 // Returns true if |url| is a print preview url.
73 static bool IsPrintPreviewURL(const GURL& url); 73 static bool IsPrintPreviewURL(const GURL& url);
74 74
75 // Erase the initiator info associated with |preview_dialog|. 75 // Erase the initiator info associated with |preview_dialog|.
76 void EraseInitiatorInfo(content::WebContents* preview_dialog); 76 void EraseInitiatorInfo(content::WebContents* preview_dialog);
77 77
78 bool is_creating_print_preview_dialog() const { 78 bool is_creating_print_preview_dialog() const {
79 return is_creating_print_preview_dialog_; 79 return is_creating_print_preview_dialog_;
80 } 80 }
81 81
82 private: 82 private:
83 friend class base::RefCounted<PrintPreviewDialogController>; 83 friend class base::RefCounted<PrintPreviewDialogController>;
84 84
85 // 1:1 relationship between a print preview dialog and its initiator tab. 85 // 1:1 relationship between a print preview dialog and its initiator tab.
86 // Key: Print preview dialog. 86 // Key: Print preview dialog.
87 // Value: Initiator. 87 // Value: Initiator.
88 typedef std::map<content::WebContents*, content::WebContents*> 88 typedef std::map<content::WebContents*, content::WebContents*>
89 PrintPreviewDialogMap; 89 PrintPreviewDialogMap;
90 90
91 virtual ~PrintPreviewDialogController(); 91 ~PrintPreviewDialogController() override;
92 92
93 // Handler for the RENDERER_PROCESS_CLOSED notification. This is observed when 93 // Handler for the RENDERER_PROCESS_CLOSED notification. This is observed when
94 // the initiator renderer crashed. 94 // the initiator renderer crashed.
95 void OnRendererProcessClosed(content::RenderProcessHost* rph); 95 void OnRendererProcessClosed(content::RenderProcessHost* rph);
96 96
97 // Handler for the WEB_CONTENTS_DESTROYED notification. This is observed when 97 // Handler for the WEB_CONTENTS_DESTROYED notification. This is observed when
98 // either WebContents is closed. 98 // either WebContents is closed.
99 void OnWebContentsDestroyed(content::WebContents* contents); 99 void OnWebContentsDestroyed(content::WebContents* contents);
100 100
101 // Handler for the NAV_ENTRY_COMMITTED notification. This is observed when the 101 // Handler for the NAV_ENTRY_COMMITTED notification. This is observed when the
(...skipping 30 matching lines...) Expand all
132 // Whether the PrintPreviewDialogController is in the middle of creating a 132 // Whether the PrintPreviewDialogController is in the middle of creating a
133 // print preview dialog. 133 // print preview dialog.
134 bool is_creating_print_preview_dialog_; 134 bool is_creating_print_preview_dialog_;
135 135
136 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDialogController); 136 DISALLOW_COPY_AND_ASSIGN(PrintPreviewDialogController);
137 }; 137 };
138 138
139 } // namespace printing 139 } // namespace printing
140 140
141 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_ 141 #endif // CHROME_BROWSER_PRINTING_PRINT_PREVIEW_DIALOG_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698