Chromium Code Reviews| Index: chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm |
| index d5c0dd75637e715108ec7bc81436001424e0e475..59c332e7109c03d01f4903b52733e6f5dbaf9d49 100644 |
| --- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm |
| +++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller.mm |
| @@ -29,8 +29,8 @@ void ShiftOriginY(NSView* view, CGFloat amount) { |
| @implementation OneClickSigninBubbleController |
| - (id)initWithBrowserWindowController:(BrowserWindowController*)controller |
| - learnMoreCallback:(const base::Closure&)learnMoreCallback |
| - advancedCallback:(const base::Closure&)advancedCallback { |
| + start_sync_callback:(const base::Callback<void(bool)>&) |
|
akalin
2012/05/17 00:39:24
line up : here too
Roger Tawa OOO till Jul 10th
2012/05/17 21:17:37
Done.
|
| + start_sync_callback { |
| NSWindow* parentWindow = [controller window]; |
| // Set the anchor point to right below the wrench menu. |
| @@ -43,26 +43,29 @@ void ShiftOriginY(NSView* view, CGFloat amount) { |
| if (self = [super initWithWindowNibPath:@"OneClickSigninBubble" |
| parentWindow:parentWindow |
| anchoredAt:anchorPoint]) { |
| - learnMoreCallback_ = learnMoreCallback; |
| - advancedCallback_ = advancedCallback; |
| - DCHECK(!learnMoreCallback_.is_null()); |
| - DCHECK(!advancedCallback_.is_null()); |
| + start_sync_callback_ = start_sync_callback; |
| + DCHECK(!start_sync_callback_.is_null()); |
| } |
| return self; |
| } |
| - (IBAction)ok:(id)sender { |
| + start_sync_callback_.Run(true); |
| [self close]; |
| } |
| -- (IBAction)onClickLearnMoreLink:(id)sender { |
| - learnMoreCallback_.Run(); |
| +- (IBAction)undo:(id)sender { |
| + [self close]; |
| } |
| - (IBAction)onClickAdvancedLink:(id)sender { |
| - advancedCallback_.Run(); |
| + start_sync_callback_.Run(false); |
| + // TODO(rogerta): why not close bubble now? |
|
akalin
2012/05/17 00:39:24
Navigating to a page already closes the infobar on
Roger Tawa OOO till Jul 10th
2012/05/17 21:17:37
Will close explicitly then. The advanced page com
|
| } |
| +// TODO(rogerta): if the bubble is closed without interaction, need to call |
| +// the callback with argument set to true. |
| + |
| - (void)awakeFromNib { |
| [super awakeFromNib]; |
| @@ -80,10 +83,6 @@ void ShiftOriginY(NSView* view, CGFloat amount) { |
| totalYOffset += |
| [GTMUILocalizerAndLayoutTweaker sizeToFitView:advancedLink_].height; |
| - ShiftOriginY(learnMoreLink_, totalYOffset); |
| - totalYOffset += |
|
akalin
2012/05/17 00:39:24
why did you remove this?
Roger Tawa OOO till Jul 10th
2012/05/17 21:17:37
I removed this because the learn more link is no l
|
| - [GTMUILocalizerAndLayoutTweaker sizeToFitView:learnMoreLink_].height; |
| - |
| ShiftOriginY(messageField_, totalYOffset); |
| totalYOffset += |
| [GTMUILocalizerAndLayoutTweaker |