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

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

Issue 10332185: Update behavior of one-click infobar to remove modal dialog, add "undo". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 7 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/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..273f56f0bb3f3ca924841336f1db82a82349bd2c 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 BrowserWindow::StartSyncCallback&)
+ start_sync_callback {
NSWindow* parentWindow = [controller window];
// Set the anchor point to right below the wrench menu.
@@ -43,26 +43,32 @@ 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(
+ OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS);
[self close];
}
- (IBAction)onClickLearnMoreLink:(id)sender {
- learnMoreCallback_.Run();
+ // TODO(akalin): this method should be removed once the UI elements are
+ // removed.
}
- (IBAction)onClickAdvancedLink:(id)sender {
- advancedCallback_.Run();
+ start_sync_callback_.Run(
+ OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST);
+ [self close];
}
+// TODO(rogerta): if the bubble is closed without interaction, need to call
+// the callback with argument set to SYNC_WITH_DEFAULT_SETTINGS.
+
- (void)awakeFromNib {
[super awakeFromNib];

Powered by Google App Engine
This is Rietveld 408576698