Chromium Code Reviews| Index: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| index 328a875de2aaf489e73b14c1d5577de94c879db3..dfd523930cd23f286bcad56334f3035bd859f017 100644 |
| --- a/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| +++ b/chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm |
| @@ -963,9 +963,6 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
| // Builds a header for signin and sync error surfacing on the user menu. |
| - (NSView*)buildSyncErrorViewIfNeeded; |
| -- (NSView*)buildSyncErrorViewWithContent:(int)contentStringId |
| - buttonStringId:(int)buttonStringId |
| - buttonAction:(SEL)buttonAction; |
| // Builds a tutorial card to introduce an upgrade user to the new avatar menu if |
| // needed. |tutorial_shown| indicates if the tutorial has already been shown in |
| @@ -1868,6 +1865,9 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
| case sync_ui_util::UNRECOVERABLE_ERROR: |
| buttonAction = @selector(showSignoutSigninView:); |
| break; |
| + case sync_ui_util::SUPERVISED_USER_AUTH_ERROR: |
| + buttonAction = nil; |
| + break; |
| case sync_ui_util::AUTH_ERROR: |
| buttonAction = @selector(showAccountReauthenticationView:); |
| break; |
| @@ -1882,32 +1882,28 @@ class ActiveProfileObserverBridge : public AvatarMenuObserver, |
| default: |
| NOTREACHED(); |
| } |
| - return [self buildSyncErrorViewWithContent:contentStringId |
| - buttonStringId:buttonStringId |
| - buttonAction:buttonAction]; |
| -} |
| -- (NSView*)buildSyncErrorViewWithContent:(int)contentStringId |
| - buttonStringId:(int)buttonStringId |
| - buttonAction:(SEL)buttonAction { |
| base::scoped_nsobject<NSView> container( |
| [[NSView alloc] initWithFrame:NSMakeRect(0, 0, GetFixedMenuWidth(), 0)]); |
| CGFloat iconSize = 20.0; |
| CGFloat xOffset = kHorizontalSpacing + iconSize + 12.0; |
| CGFloat availableWidth = GetFixedMenuWidth() - xOffset - kHorizontalSpacing; |
| - CGFloat yOffset = 20.0; |
| + CGFloat yOffset = 16.0; |
| // Adds an action button for resolving the error at the bottom. |
| - base::scoped_nsobject<NSButton> resolveErrorButton( |
| - [[BlueLabelButton alloc] initWithFrame:NSZeroRect]); |
| - [resolveErrorButton setTitle:l10n_util::GetNSString(buttonStringId)]; |
| - [resolveErrorButton setTarget:self]; |
| - [resolveErrorButton setAction:buttonAction]; |
| - [resolveErrorButton setAlignment:NSCenterTextAlignment]; |
| - [resolveErrorButton sizeToFit]; |
| - [resolveErrorButton setFrameOrigin:NSMakePoint(xOffset, yOffset)]; |
| - [container addSubview:resolveErrorButton]; |
| - yOffset = NSMaxY([resolveErrorButton frame]) + kVerticalSpacing; |
| + if (buttonStringId) { |
| + DCHECK(buttonAction); |
|
groby-ooo-7-16
2016/08/23 15:16:49
You added a buttonAction = nil case above. Is th D
Jane
2016/08/23 16:39:38
Yes - when a button string is returned, that means
|
| + base::scoped_nsobject<NSButton> resolveErrorButton( |
| + [[BlueLabelButton alloc] initWithFrame:NSZeroRect]); |
| + [resolveErrorButton setTitle:l10n_util::GetNSString(buttonStringId)]; |
| + [resolveErrorButton setTarget:self]; |
| + [resolveErrorButton setAction:buttonAction]; |
| + [resolveErrorButton setAlignment:NSCenterTextAlignment]; |
| + [resolveErrorButton sizeToFit]; |
| + [resolveErrorButton setFrameOrigin:NSMakePoint(xOffset, yOffset + 4.0)]; |
| + [container addSubview:resolveErrorButton]; |
| + yOffset = NSMaxY([resolveErrorButton frame]) + kVerticalSpacing; |
| + } |
| // Adds the error message content. |
| NSTextField* contentLabel = |