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

Unified Diff: chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm

Issue 2174573002: [Constrained Web Dialogs] [Cocoa] Enable autoresizing immediately if intended. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm
diff --git a/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm b/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm
index e742f0e366d45fb61a51e6f25184914b01f844f9..9ef87e6b73aa7350a02eaa7dd2a93749a4a357a0 100644
--- a/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/constrained_web_dialog_delegate_mac.mm
@@ -149,11 +149,7 @@ class ConstrainedWebDialogDelegateViewMac :
EnableAutoResize();
}
void DocumentOnLoadCompletedInMainFrame() override {
- if (!IsDialogAutoResizable())
- return;
-
- EnableAutoResize();
- if (GetWebContents())
+ if (IsDialogAutoResizable() && GetWebContents())
constrained_window_->ShowWebContentsModalDialog();
}
@@ -202,8 +198,10 @@ ConstrainedWebDialogDelegateViewMac::ConstrainedWebDialogDelegateViewMac(
this)),
min_size_(min_size),
max_size_(max_size) {
- if (IsDialogAutoResizable())
+ if (IsDialogAutoResizable()) {
Observe(GetWebContents());
+ EnableAutoResize();
+ }
// Create a window to hold web_contents in the constrained sheet:
gfx::Size size;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698