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

Side by Side Diff: chrome/browser/signin/signin_manager.cc

Issue 11312124: Send a notification when the signed-in user is about to sign out. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return; 359 return;
360 } 360 }
361 361
362 GoogleServiceSignoutDetails details(authenticated_username_); 362 GoogleServiceSignoutDetails details(authenticated_username_);
363 363
364 ClearTransientSigninData(); 364 ClearTransientSigninData();
365 authenticated_username_.clear(); 365 authenticated_username_.clear();
366 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername); 366 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername);
367 profile_->GetPrefs()->ClearPref(prefs::kIsGooglePlusUser); 367 profile_->GetPrefs()->ClearPref(prefs::kIsGooglePlusUser);
368 TokenService* token_service = TokenServiceFactory::GetForProfile(profile_); 368 TokenService* token_service = TokenServiceFactory::GetForProfile(profile_);
369 token_service->ResetCredentialsInMemory();
370 token_service->EraseTokensFromDB();
371 content::NotificationService::current()->Notify( 369 content::NotificationService::current()->Notify(
372 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, 370 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT,
373 content::Source<Profile>(profile_), 371 content::Source<Profile>(profile_),
374 content::Details<const GoogleServiceSignoutDetails>(&details)); 372 content::Details<const GoogleServiceSignoutDetails>(&details));
373 token_service->ResetCredentialsInMemory();
374 token_service->EraseTokensFromDB();
375 } 375 }
376 376
377 bool SigninManager::AuthInProgress() const { 377 bool SigninManager::AuthInProgress() const {
378 return !possibly_invalid_username_.empty(); 378 return !possibly_invalid_username_.empty();
379 } 379 }
380 380
381 void SigninManager::OnGetUserInfoKeyNotFound(const std::string& key) { 381 void SigninManager::OnGetUserInfoKeyNotFound(const std::string& key) {
382 DCHECK(key == kGetInfoEmailKey); 382 DCHECK(key == kGetInfoEmailKey);
383 LOG(ERROR) << "Account is not associated with a valid email address. " 383 LOG(ERROR) << "Account is not associated with a valid email address. "
384 << "Login failed."; 384 << "Login failed.";
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 void SigninManager::OnPreferenceChanged(PrefServiceBase* service, 540 void SigninManager::OnPreferenceChanged(PrefServiceBase* service,
541 const std::string& pref_name) { 541 const std::string& pref_name) {
542 DCHECK_EQ(std::string(prefs::kGoogleServicesUsernamePattern), pref_name); 542 DCHECK_EQ(std::string(prefs::kGoogleServicesUsernamePattern), pref_name);
543 if (!authenticated_username_.empty() && 543 if (!authenticated_username_.empty() &&
544 !IsAllowedUsername(authenticated_username_)) { 544 !IsAllowedUsername(authenticated_username_)) {
545 // Signed in user is invalid according to the current policy so sign 545 // Signed in user is invalid according to the current policy so sign
546 // the user out. 546 // the user out.
547 SignOut(); 547 SignOut();
548 } 548 }
549 } 549 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698