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

Side by Side Diff: chrome/browser/signin/signin_manager_fake.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
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_fake.h" 5 #include "chrome/browser/signin/signin_manager_fake.h"
6 6
7 #include "chrome/common/chrome_notification_types.h" 7 #include "chrome/common/chrome_notification_types.h"
8 #include "content/public/browser/notification_service.h" 8 #include "content/public/browser/notification_service.h"
9 9
10 FakeSigninManager::FakeSigninManager(Profile* profile) { 10 FakeSigninManager::FakeSigninManager(Profile* profile) {
(...skipping 15 matching lines...) Expand all
26 const std::string& password) { 26 const std::string& password) {
27 SetAuthenticatedUsername(username); 27 SetAuthenticatedUsername(username);
28 } 28 }
29 29
30 void FakeSigninManager::StartSignInWithOAuth(const std::string& username, 30 void FakeSigninManager::StartSignInWithOAuth(const std::string& username,
31 const std::string& password) { 31 const std::string& password) {
32 SetAuthenticatedUsername(username); 32 SetAuthenticatedUsername(username);
33 } 33 }
34 34
35 void FakeSigninManager::SignOut() { 35 void FakeSigninManager::SignOut() {
36 content::NotificationService::current()->Notify(
37 chrome::NOTIFICATION_GOOGLE_WILL_SIGN_OUT,
38 content::Source<Profile>(profile_),
39 content::NotificationService::NoDetails());
36 authenticated_username_.clear(); 40 authenticated_username_.clear();
37 content::NotificationService::current()->Notify( 41 content::NotificationService::current()->Notify(
38 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, 42 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT,
39 content::Source<Profile>(profile_), 43 content::Source<Profile>(profile_),
40 content::NotificationService::NoDetails()); 44 content::NotificationService::NoDetails());
41 } 45 }
42 46
43 // static 47 // static
44 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) { 48 ProfileKeyedService* FakeSigninManager::Build(Profile* profile) {
45 return new FakeSigninManager(profile); 49 return new FakeSigninManager(profile);
46 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698