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

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

Issue 8220026: Add new methods to create constrained windows for print preview and release the internal TabConte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/constrained_html_ui.h
===================================================================
--- chrome/browser/ui/webui/constrained_html_ui.h (revision 104824)
+++ chrome/browser/ui/webui/constrained_html_ui.h (working copy)
@@ -23,6 +23,14 @@
// Called when the dialog is being closed in response to a "DialogClose"
// message from WebUI.
virtual void OnDialogCloseFromWebUI() = 0;
+
+ // If called, on dialog closure, the dialog will release its TabContents
+ // instead of destroying it. After which point, the caller will own the
+ // released TabContents.
+ virtual void ReleaseTabContentsOnDialogClose() = 0;
+
+ protected:
+ virtual ~ConstrainedHtmlUIDelegate() {}
};
// ConstrainedHtmlUI is a facility to show HTML WebUI content
@@ -46,12 +54,23 @@
HtmlDialogUIDelegate* delegate,
TabContentsWrapper* overshadowed);
+ // Similar to CreateConstrainedHtmlDialog() but specifically for print
+ // preview, where we care about the constrained TabContentsWrapper rather
+ // than the ConstrainedWindow.
+ static TabContentsWrapper* CreateConstrainedPrintPreviewHtmlUI(
+ Profile* profile,
+ HtmlDialogUIDelegate* delegate,
+ TabContentsWrapper* overshadowed);
+
// Returns a property accessor that can be used to set the
// ConstrainedHtmlUIDelegate property on a TabContents.
static PropertyAccessor<ConstrainedHtmlUIDelegate*>&
GetPropertyAccessor();
private:
+ FRIEND_TEST_ALL_PREFIXES(ConstrainedHtmlDialogBrowserTest,
+ ReleaseTabContentsOnDialogClose);
+
// Returns the TabContents' PropertyBag's ConstrainedHtmlUIDelegate.
// Returns NULL if that property is not set.
ConstrainedHtmlUIDelegate* GetConstrainedDelegate();

Powered by Google App Engine
This is Rietveld 408576698