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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm

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
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
index 775ae154665490be79c47801ddf24210e1f13479..9bd73cf17d8034ecb1b89693874871ce40ca4b17 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_web_dialog_sheet.mm
@@ -20,13 +20,13 @@
- (void)updateSheetPosition {
if (web_dialog_delegate_) {
- gfx::Size size;
+ // If the dialog has autoresizing enabled and |current_size_| has been set,
+ // GetDialogSize() doesn't modify |size|.
+ gfx::Size size(current_size_.width, current_size_.height);
web_dialog_delegate_->GetDialogSize(&size);
+ DCHECK(!size.IsEmpty());
- // If the dialog has autoresizing enabled, |size| will be empty. Use the
- // last known dialog size.
- NSSize content_size = size.IsEmpty() ? current_size_ :
- NSMakeSize(size.width(), size.height());
+ NSSize content_size = NSMakeSize(size.width(), size.height());
[customWindow_ setContentSize:content_size];
}
[super updateSheetPosition];

Powered by Google App Engine
This is Rietveld 408576698