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

Side by Side Diff: chrome/browser/ui/cocoa/profiles/profile_chooser_controller.mm

Issue 2920853004: [sync] Display an error when sync settings aren't confirmed (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/profiles/profile_chooser_controller.h"
6 6
7 #import <Carbon/Carbon.h> // kVK_Return. 7 #import <Carbon/Carbon.h> // kVK_Return.
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1200 otherProfiles:otherProfiles.get() 1200 otherProfiles:otherProfiles.get()
1201 atYOffset:yOffset 1201 atYOffset:yOffset
1202 inContainer:container 1202 inContainer:container
1203 showLock:showLock]; 1203 showLock:showLock];
1204 return container.autorelease(); 1204 return container.autorelease();
1205 } 1205 }
1206 1206
1207 - (NSView*)buildSyncErrorViewIfNeeded { 1207 - (NSView*)buildSyncErrorViewIfNeeded {
1208 int contentStringId, buttonStringId; 1208 int contentStringId, buttonStringId;
1209 SEL buttonAction; 1209 SEL buttonAction;
1210 SigninManagerBase* signinManager =
1211 SigninManagerFactory::GetForProfile(browser_->profile());
1210 sync_ui_util::AvatarSyncErrorType error = 1212 sync_ui_util::AvatarSyncErrorType error =
1211 sync_ui_util::GetMessagesForAvatarSyncError( 1213 sync_ui_util::GetMessagesForAvatarSyncError(
1212 browser_->profile(), &contentStringId, &buttonStringId); 1214 browser_->profile(), *signinManager, &contentStringId,
1215 &buttonStringId);
1213 switch (error) { 1216 switch (error) {
1214 case sync_ui_util::MANAGED_USER_UNRECOVERABLE_ERROR: 1217 case sync_ui_util::MANAGED_USER_UNRECOVERABLE_ERROR:
1215 buttonAction = @selector(showSignoutView:); 1218 buttonAction = @selector(showSignoutView:);
1216 break; 1219 break;
1217 case sync_ui_util::UNRECOVERABLE_ERROR: 1220 case sync_ui_util::UNRECOVERABLE_ERROR:
1218 buttonAction = @selector(showSignoutSigninView:); 1221 buttonAction = @selector(showSignoutSigninView:);
1219 break; 1222 break;
1220 case sync_ui_util::SUPERVISED_USER_AUTH_ERROR: 1223 case sync_ui_util::SUPERVISED_USER_AUTH_ERROR:
1221 buttonAction = nil; 1224 buttonAction = nil;
1222 break; 1225 break;
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 2112
2110 - (void)showWindow:(id)sender { 2113 - (void)showWindow:(id)sender {
2111 [super showWindow:sender]; 2114 [super showWindow:sender];
2112 NSEvent *event = [[NSApplication sharedApplication] currentEvent]; 2115 NSEvent *event = [[NSApplication sharedApplication] currentEvent];
2113 if (firstProfileView_ && [event type] == NSKeyDown) { 2116 if (firstProfileView_ && [event type] == NSKeyDown) {
2114 [[self window] makeFirstResponder:firstProfileView_]; 2117 [[self window] makeFirstResponder:firstProfileView_];
2115 } 2118 }
2116 } 2119 }
2117 2120
2118 @end 2121 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698