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 e085e90ab25493526cd5822cf7f8f6ed4ae45c06..537b68bf3221a458be51c04d5f92d06083f582f5 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 |
@@ -41,6 +41,13 @@ const int kSyncConfirmationDialogHeight = 351; |
// Initial height of the signin error modal dialog. |
const int kSigninErrorDialogHeight = 164; |
+CGFloat GetSyncConfirmationDialogPreferredHeight(Profile* profile) { |
+ // If sync is disabled, then the sync confirmation dialog looks like an error |
+ // dialog and thus it has the same preferred size. |
+ return profile->IsSyncAllowed() ? kSyncConfirmationDialogHeight |
+ : kSigninErrorDialogHeight; |
+} |
+ |
} // namespace |
SigninViewControllerDelegateMac::SigninViewControllerDelegateMac( |
@@ -112,8 +119,9 @@ SigninViewControllerDelegateMac::CreateSyncConfirmationWebContents( |
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
NSView* webview = web_contents->GetNativeView(); |
- [webview setFrameSize:NSMakeSize(kModalDialogWidth, |
- kSyncConfirmationDialogHeight)]; |
+ [webview setFrameSize:NSMakeSize( |
+ kModalDialogWidth, |
+ GetSyncConfirmationDialogPreferredHeight(profile))]; |
return web_contents; |
} |
@@ -203,7 +211,7 @@ SigninViewControllerDelegate::CreateSyncConfirmationDelegate( |
browser->profile()), |
browser->tab_strip_model()->GetActiveWebContents(), |
NSMakeRect(0, 0, kModalDialogWidth, |
- kSyncConfirmationDialogHeight), |
+ GetSyncConfirmationDialogPreferredHeight(browser->profile())), |
true); |
} |