Chromium Code Reviews| Index: chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc |
| diff --git a/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc b/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc |
| index ad69808749ce7dd72bfd8aedcdc801c2c8f82e9b..399856de301c94525ccaf0e7c3607ac5a55d5a86 100644 |
| --- a/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc |
| @@ -77,7 +77,20 @@ class MediaRouterDialogDelegate : public WebDialogDelegate { |
| // MediaRouterUI adds its own message handlers. |
| } |
| - void GetDialogSize(gfx::Size* size) const override; |
| + void GetDialogSize(gfx::Size* size) const override { |
| + DCHECK(size); |
| +#if defined(OS_MACOSX) |
| + // We need to set the initial size to be positive for OSX, otherwise the |
| + // dialog may fail to show. |
|
apacible
2016/09/06 17:24:53
Add a comment mentioning this is done because spec
takumif
2016/09/06 19:01:37
Done.
|
| + if (size->IsEmpty()) |
|
apacible
2016/08/31 18:19:12
I would prefer handling everything on the sheets s
takumif
2016/08/31 22:44:30
I don't think the sheet has enough information to
apacible
2016/09/06 17:24:53
Acknowledged. I don't think having an arbitrary si
|
| + *size = gfx::Size(kWidth, kMinHeight); |
| +#endif |
| + // GetDialogSize() is called when the dialog is created or the browser |
| + // window resizes. We may want to update the maximum height of the dialog |
| + // and scale the WebUI to the new height. |size| is not set (except for in |
| + // OSX) because the dialog is auto-resizeable. |
| + controller_->UpdateMaxDialogSize(); |
| + } |
| std::string GetDialogArgs() const override { |
| return std::string(); |
| @@ -106,14 +119,6 @@ class MediaRouterDialogDelegate : public WebDialogDelegate { |
| DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogDelegate); |
| }; |
| -void MediaRouterDialogDelegate::GetDialogSize(gfx::Size* size) const { |
| - DCHECK(size); |
| - // GetDialogSize() is called when the browser window resizes. We may want to |
| - // update the maximum height of the dialog and scale the WebUI to the new |
| - // height. |size| is not set because the dialog is auto-resizeable. |
| - controller_->UpdateMaxDialogSize(); |
| -} |
| - |
| } // namespace |
| // static |