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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 10496010: Updated SigninManager and TokenService to generate notifications at signout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify cros code in SyncSetupHandler. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/webui/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/sync_setup_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 // Let the various services know that we're no longer active. 862 // Let the various services know that we're no longer active.
863 GetLoginUIService()->LoginUIClosed(this); 863 GetLoginUIService()->LoginUIClosed(this);
864 if (sync_service) 864 if (sync_service)
865 sync_service->set_setup_in_progress(false); 865 sync_service->set_setup_in_progress(false);
866 866
867 // Make sure user isn't left half-logged-in (signed in, but without sync 867 // Make sure user isn't left half-logged-in (signed in, but without sync
868 // started up). If the user hasn't finished setting up sync, then sign out 868 // started up). If the user hasn't finished setting up sync, then sign out
869 // and shut down sync. 869 // and shut down sync.
870 if (sync_service && !sync_service->HasSyncSetupCompleted()) { 870 if (sync_service && !sync_service->HasSyncSetupCompleted()) {
871 DVLOG(1) << "Signin aborted by user action"; 871 DVLOG(1) << "Signin aborted by user action";
872 // Calling DisableForUser() will also sign the user out on desktop
873 // platforms.
Roger Tawa OOO till Jul 10th 2012/06/04 13:43:40 nit: the comment is not completely accurate, since
Andrew T Wilson (Slow) 2012/06/04 16:06:26 Hmmm. I was trying to be explicit by saying "deskt
872 sync_service->DisableForUser(); 874 sync_service->DisableForUser();
873 #if !defined(OS_CHROMEOS) 875
874 GetSignin()->SignOut(); 876 #if defined(OS_CHROMEOS)
875 #else 877 // Suppress sync startup on ChromeOS, so it doesn't get restarted when
876 // TODO(atwilson): Move this suppression to PSS::DisableForUser() 878 // the user logs in again.
877 browser_sync::SyncPrefs sync_prefs(GetProfile()->GetPrefs()); 879 browser_sync::SyncPrefs sync_prefs(GetProfile()->GetPrefs());
878 sync_prefs.SetStartSuppressed(true); 880 sync_prefs.SetStartSuppressed(true);
879 #endif 881 #endif
880 } 882 }
881 } 883 }
882 884
883 configuring_sync_ = false; 885 configuring_sync_ = false;
884 signin_tracker_.reset(); 886 signin_tracker_.reset();
885 } 887 }
886 888
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 if (i != current_profile_index && AreUserNamesEqual( 1015 if (i != current_profile_index && AreUserNamesEqual(
1014 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { 1016 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) {
1015 *error_message = l10n_util::GetStringUTF16( 1017 *error_message = l10n_util::GetStringUTF16(
1016 IDS_SYNC_USER_NAME_IN_USE_ERROR); 1018 IDS_SYNC_USER_NAME_IN_USE_ERROR);
1017 return false; 1019 return false;
1018 } 1020 }
1019 } 1021 }
1020 1022
1021 return true; 1023 return true;
1022 } 1024 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698