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

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

Issue 12539002: Hide the add new profile link for managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix problem with unit test. Created 7 years, 8 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 | « chrome/browser/profiles/avatar_menu_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
index 338e398ebab412505688fab2de6c823f52fca86b..b6e3046cd2cd35661b1eaf089f271f2e886d7c47 100644
--- a/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm
@@ -128,17 +128,21 @@ const CGFloat kLabelInset = 49.0;
// into the xib, and this gives a little more space to visually match.
CGFloat yOffset = kLinkSpacing;
- // Since drawing happens bottom-up, start with the "New User" link.
- NSButton* newButton = [self configureNewUserButton:yOffset];
- [contentView addSubview:newButton];
- yOffset += NSHeight([newButton frame]) + kVerticalSpacing;
-
- NSBox* separator = [self separatorWithFrame:
- NSMakeRect(10, yOffset, NSWidth([contentView frame]) - 20, 0)];
- [separator setAutoresizingMask:NSViewWidthSizable];
- [contentView addSubview:separator];
-
- yOffset += NSHeight([separator frame]);
+ if (model_->ShouldShowAddNewProfileLink()) {
+ // Since drawing happens bottom-up, start with the "New User" link.
+ NSButton* newButton = [self configureNewUserButton:yOffset];
+ [contentView addSubview:newButton];
+ yOffset += NSHeight([newButton frame]) + kVerticalSpacing;
+
+ NSBox* separator = [self separatorWithFrame:
+ NSMakeRect(10, yOffset, NSWidth([contentView frame]) - 20, 0)];
+ [separator setAutoresizingMask:NSViewWidthSizable];
+ [contentView addSubview:separator];
+
+ yOffset += NSHeight([separator frame]);
+ } else {
+ yOffset = 7;
+ }
// Loop over the profiles in reverse, constructing the menu items.
CGFloat widthAdjust = 0;
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698