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

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

Issue 754953002: Enable AutoResize for Constrained Web Dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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_web_dialog_ui.h
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui.h b/chrome/browser/ui/webui/constrained_web_dialog_ui.h
index 172fab6b2c623a89f0fc471c8a9eedd92d317e0a..9c4fa87424af31b297a20938db96fbffc1ccfbb6 100644
--- a/chrome/browser/ui/webui/constrained_web_dialog_ui.h
+++ b/chrome/browser/ui/webui/constrained_web_dialog_ui.h
@@ -10,6 +10,10 @@
#include "content/public/browser/web_ui_controller.h"
#include "ui/gfx/native_widget_types.h"
+namespace gfx {
+class Size;
+}
+
namespace content {
class BrowserContext;
class RenderViewHost;
@@ -41,6 +45,14 @@ class ConstrainedWebDialogDelegate {
// Returns the native type used to display the dialog.
virtual web_modal::NativeWebContentsModalDialog GetNativeDialog() = 0;
+ // Returns the minimum size for the dialog.
+ virtual gfx::Size GetMinimumSize() const = 0;
+
+ // Returns the maximum size for the dialog.
+ virtual gfx::Size GetMaximumSize() const = 0;
+
+ virtual gfx::Size GetPreferredSize() const = 0;
+
protected:
virtual ~ConstrainedWebDialogDelegate() {}
};
@@ -75,16 +87,31 @@ class ConstrainedWebDialogUI : public content::WebUIController {
DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogUI);
};
-// Create a constrained HTML dialog. The actual object that gets created
-// is a ConstrainedWebDialogDelegate, which later triggers construction of a
-// ConstrainedWebDialogUI object.
+// Create and show a constrained HTML dialog. The actual object that gets
+// created is a ConstrainedWebDialogDelegate, which later triggers construction
+// of a ConstrainedWebDialogUI object.
// |browser_context| is used to construct the constrained HTML dialog's
// WebContents.
// |delegate| controls the behavior of the dialog.
// |overshadowed| is the tab being overshadowed by the dialog.
-ConstrainedWebDialogDelegate* CreateConstrainedWebDialog(
+ConstrainedWebDialogDelegate* ShowConstrainedWebDialog(
content::BrowserContext* browser_context,
ui::WebDialogDelegate* delegate,
content::WebContents* overshadowed);
+// Create and show a constrained HTML dialog with auto-resize enabled. The
+// dialog is shown automatically with a call to PopupManager->ShowModalDialog()
+// after document load has completed to avoid UI jankiness.
+// |browser_context| is used to construct the dialog's WebContents.
+// |delegate| controls the behavior of the dialog.
+// |overshadowed| is the tab being overshadowed by the dialog.
+// |min_size| is the minimum size of the dialog.
+// |max_size| is the maximum size of the dialog.
+ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize(
+ content::BrowserContext* browser_context,
+ ui::WebDialogDelegate* delegate,
+ content::WebContents* overshadowed,
+ const gfx::Size& min_size,
+ const gfx::Size& max_size);
+
#endif // CHROME_BROWSER_UI_WEBUI_CONSTRAINED_WEB_DIALOG_UI_H_

Powered by Google App Engine
This is Rietveld 408576698