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

Unified Diff: chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm

Issue 2685163003: Avoid multiple displays of the sign-in dialogs. (Closed)
Patch Set: Ready for reviews Created 3 years, 10 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/profiles/signin_view_controller_delegate_mac.mm
diff --git a/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm b/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
index c680b316430ce81bfe8c2e1bdf87ac9b52b3531b..9741d0f197f245a1351ec5fa18b332f95cadae76 100644
--- a/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/profiles/signin_view_controller_delegate_mac.mm
@@ -59,7 +59,6 @@ SigninViewControllerDelegateMac::SigninViewControllerDelegateMac(
bool wait_for_size)
: SigninViewControllerDelegate(signin_view_controller, web_contents.get()),
web_contents_(std::move(web_contents)),
- wait_for_size_(wait_for_size),
browser_(browser),
dialog_modal_type_(dialog_modal_type),
window_frame_(frame) {
@@ -67,7 +66,7 @@ SigninViewControllerDelegateMac::SigninViewControllerDelegateMac(
DCHECK(browser_->tab_strip_model()->GetActiveWebContents())
<< "A tab must be active to present the sign-in modal dialog.";
- if (!wait_for_size_)
+ if (!wait_for_size)
DisplayModal();
}
@@ -168,16 +167,15 @@ void SigninViewControllerDelegateMac::PerformClose() {
}
void SigninViewControllerDelegateMac::ResizeNativeView(int height) {
- if (wait_for_size_) {
- [window_.get().contentView
- setFrameSize:NSMakeSize(kModalDialogWidth,
- height)];
+ if (!window_) {
window_frame_.size = NSMakeSize(kModalDialogWidth, height);
DisplayModal();
}
}
void SigninViewControllerDelegateMac::DisplayModal() {
+ DCHECK(!window_);
+
content::WebContents* host_web_contents =
browser_->tab_strip_model()->GetActiveWebContents();

Powered by Google App Engine
This is Rietveld 408576698