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

Unified Diff: chrome/browser/ui/webui/print_preview_ui.h

Issue 8520011: Print Preview: Make print preview tab modal. (try 2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: disable tests in touch_ui, fix failing test Created 9 years, 1 month 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/ui/webui/print_preview_ui.h
===================================================================
--- chrome/browser/ui/webui/print_preview_ui.h (revision 110066)
+++ chrome/browser/ui/webui/print_preview_ui.h (working copy)
@@ -12,7 +12,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/time.h"
#include "chrome/browser/printing/print_preview_data_service.h"
-#include "chrome/browser/ui/webui/chrome_web_ui.h"
+#include "chrome/browser/ui/webui/constrained_html_ui.h"
class PrintPreviewDataService;
class PrintPreviewHandler;
@@ -22,7 +22,7 @@
struct PageSizeMargins;
}
-class PrintPreviewUI : public ChromeWebUI {
+class PrintPreviewUI : public ConstrainedHtmlUI {
public:
explicit PrintPreviewUI(TabContents* contents);
virtual ~PrintPreviewUI();
@@ -100,13 +100,14 @@
// Notifies the Web UI that the print preview failed to render.
void OnPrintPreviewFailed();
+ // Notified the Web UI that this print preview tab's RenderProcess has been
+ // closed, which may occur for several reasons, e.g. tab closure or crash.
+ void OnPrintPreviewTabClosed();
+
// Notifies the Web UI that initiator tab is closed, so we can disable all the
// controls that need the initiator tab for generating the preview data.
void OnInitiatorTabClosed();
- // Notifies the Web UI that the initiator tab has crashed.
- void OnInitiatorTabCrashed();
-
// Notifies the Web UI renderer that file selection has been cancelled.
void OnFileSelectionCancelled();
@@ -117,6 +118,15 @@
// Notifies the Web UI to cancel the pending preview request.
void OnCancelPendingPreviewRequest();
+ // Hides the print preview tab.
+ void OnHidePreviewTab();
+
+ // Closes the print preview tab.
+ void OnClosePrintPreviewTab();
+
+ // Reload the printers list.
+ void OnReloadPrintersList();
+
private:
friend class PrintPreviewHandlerTest;
FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, StickyMarginsCustom);
@@ -152,6 +162,9 @@
// title.
string16 initiator_tab_title_;
+ // Keeps track of whether OnClosePrintPreviewTab() has been called or not.
+ bool tab_closed_;
+
DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI);
};

Powered by Google App Engine
This is Rietveld 408576698