summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h
diff options
context:
space:
mode:
authorapacible <apacible@chromium.org>2016-03-09 22:10:36 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-10 06:12:01 +0000
commit740c4109f954a11c544c02132a89fabab767e7ab (patch)
treeac48e487732a25ea45a9ddf785a661f9b749cf9e /chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h
parent57b0ce21651317b36f6c5cd0888a011e71f2ace8 (diff)
downloadchromium_src-740c4109f954a11c544c02132a89fabab767e7ab.zip
chromium_src-740c4109f954a11c544c02132a89fabab767e7ab.tar.gz
chromium_src-740c4109f954a11c544c02132a89fabab767e7ab.tar.bz2
[Reland] Enable AutoResize for Constrained Web Dialogs for Mac.
Currently only constrained web dialogs for views (Linux/Windows) are able to autoresize. This change implements the option to pass in minimum and maximum sizes and enabling autoresizing functionality for OSX. This change adds two static functions for options on whether to create a ConstrainedWindowsMac that autoresizes or is of fixed size. The first two patches were reverted because of flaky tests on Mac 10.9. Those patches can be found at: 1. https://codereview.chromium.org/1430023002 2. https://codereview.chromium.org/1446623003 After some investigation, we found that the failures are being caused by an occlusion notifications in cocoa, which is not expected in browser tests. This is currently mac-only. By disabling these notifications in browser tests, we see this patch passing on the swarming bots that were previously failing. See http://crbug/558585. The patch to disable occlusion notifications can be found at: https://codereview.chromium.org/1762883002/ The third patch (same as second patch) broke dialogs like print preview. This was because the change used ui::kWindowSizeDeterminedLater for the dialog window's frame for all constrained web dialogs on mac, not just autoresizable dialogs. That has been amended in this change. That patch can be found here: https://codereview.chromium.org/1699763002/ BUG=217034 Review URL: https://codereview.chromium.org/1781433002 Cr-Commit-Position: refs/heads/master@{#380352}
Diffstat (limited to 'chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h')
-rw-r--r--chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h
index fee4931..a43814a 100644
--- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h
+++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h
@@ -24,6 +24,8 @@ class ConstrainedWebDialogDelegateBase
: public ConstrainedWebDialogDelegate,
public ui::WebDialogWebContentsDelegate {
public:
+ // |browser_context| and |delegate| must outlive |this| instance, whereas
+ // |this| will take ownership of |tab_delegate|.
ConstrainedWebDialogDelegateBase(content::BrowserContext* browser_context,
ui::WebDialogDelegate* delegate,
WebDialogWebContentsDelegate* tab_delegate);
@@ -47,6 +49,9 @@ class ConstrainedWebDialogDelegateBase
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
+ // Resize the dialog to the given size.
+ virtual void ResizeToGivenSize(const gfx::Size size);
+
private:
scoped_ptr<ui::WebDialogDelegate> web_dialog_delegate_;