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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc

Issue 2275413002: Make the MediaRouterDialogDelegate set initial dialog size in OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698