diff options
author | apacible <apacible@chromium.org> | 2015-11-13 11:13:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-13 19:14:28 +0000 |
commit | 5acf85a4aebf309d5cb11c6774ef3a067d12a21a (patch) | |
tree | 9f1d97f109d542761e624f93749b01e186bc465d /chrome/browser/ui/webui | |
parent | 6c65b9ada7990e322be4accae2c628ce494adc12 (diff) | |
download | chromium_src-5acf85a4aebf309d5cb11c6774ef3a067d12a21a.zip chromium_src-5acf85a4aebf309d5cb11c6774ef3a067d12a21a.tar.gz chromium_src-5acf85a4aebf309d5cb11c6774ef3a067d12a21a.tar.bz2 |
Revert of Enable AutoResize for Constrained Web Dialogs for Mac. (patchset #4 id:650001 of https://codereview.chromium.org/1430023002/ )
Reason for revert:
This is breaking Mac10.9 browser_tests (flaky):
https://build.chromium.org/p/chromium.mac/builders/Mac10.9%20Tests/builds/11410
https://build.chromium.org/p/chromium.mac/builders/Mac10.9%20Tests/builds/11410/steps/browser_tests%20on%20Mac-10.9/logs/ConstrainedWebDialogBrowserTest.ContentResizeInAutoResizingDialog
Original issue's description:
> 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.
>
> BUG=217034
>
> Committed: https://crrev.com/0dbc8ff6d68291773b8b233a19e399d00f9262b0
> Cr-Commit-Position: refs/heads/master@{#359497}
TBR=thakis@chromium.org,erikchen@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=217034
Review URL: https://codereview.chromium.org/1440173003
Cr-Commit-Position: refs/heads/master@{#359593}
Diffstat (limited to 'chrome/browser/ui/webui')
4 files changed, 6 insertions, 12 deletions
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc index db4c547..fd60a4b 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc +++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc @@ -113,8 +113,3 @@ gfx::Size ConstrainedWebDialogDelegateBase::GetPreferredSize() const { NOTREACHED(); return gfx::Size(); } - -void ConstrainedWebDialogDelegateBase::ResizeToGivenSize( - const gfx::Size size) { - NOTREACHED(); -} 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 2fac4b5..973608f 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h +++ b/chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h @@ -23,8 +23,6 @@ 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); @@ -48,9 +46,6 @@ 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_; diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui.h b/chrome/browser/ui/webui/constrained_web_dialog_ui.h index c0e883c..62c9a8b 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_ui.h +++ b/chrome/browser/ui/webui/constrained_web_dialog_ui.h @@ -50,8 +50,6 @@ class ConstrainedWebDialogDelegate { // Returns the maximum size for the dialog. virtual gfx::Size GetMaximumSize() const = 0; - // Returns the preferred size for the dialog, or an empty size if - // the dialog has been closed. virtual gfx::Size GetPreferredSize() const = 0; protected: diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc index 88f6c7f..08fec2d 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc +++ b/chrome/browser/ui/webui/constrained_web_dialog_ui_browsertest.cc @@ -25,6 +25,7 @@ using web_modal::WebContentsModalDialogManager; namespace { +#if !defined(OS_MACOSX) static const char kTestDataURL[] = "data:text/html,<!doctype html>" "<body></body>" "<style>" @@ -40,6 +41,7 @@ std::string GetChangeDimensionsScript(int dimension) { return base::StringPrintf("window.document.body.style.width = %d + 'px';" "window.document.body.style.height = %d + 'px';", dimension, dimension); } +#endif class ConstrainedWebDialogBrowserTestObserver : public content::WebContentsObserver { @@ -133,6 +135,7 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, EXPECT_TRUE(observer.contents_destroyed()); } +#if !defined(OS_MACOSX) // Tests that dialog autoresizes based on web contents when autoresizing // is enabled. IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, @@ -171,6 +174,7 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, EXPECT_EQ(max_size, dialog_delegate->GetMaximumSize()); // Check for initial sizing. Dialog was created as a 400x400 dialog. + EXPECT_EQ(gfx::Size(), web_contents->GetPreferredSize()); ASSERT_EQ(initial_dialog_size, dialog_delegate->GetPreferredSize()); observer.Wait(); @@ -234,6 +238,7 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, delegate->GetDialogSize(&initial_dialog_size); // Check for initial sizing. Dialog was created as a 400x400 dialog. + EXPECT_EQ(gfx::Size(), web_contents->GetPreferredSize()); ASSERT_EQ(initial_dialog_size, dialog_delegate->GetPreferredSize()); // Resize <body> to dimension smaller than dialog. @@ -252,3 +257,4 @@ IN_PROC_BROWSER_TEST_F(ConstrainedWebDialogBrowserTest, initial_dialog_size, dialog_delegate))); } +#endif // !OS_MACOSX |