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

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

Issue 2450843002: Indicate that sync was disabled by administrator. (Closed)
Patch Set: Address code review. Created 4 years, 2 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698