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

Side by Side Diff: chrome/browser/services/gcm/fake_signin_manager.cc

Issue 617183003: Make sure GetAuthenticatedAccountId() returns a canonicalized id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 2 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 #include "chrome/browser/services/gcm/fake_signin_manager.h" 5 #include "chrome/browser/services/gcm/fake_signin_manager.h"
6 6
7 #include "base/observer_list.h" 7 #include "base/observer_list.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 27 matching lines...) Expand all
38 SetAuthenticatedUsername(username); 38 SetAuthenticatedUsername(username);
39 FOR_EACH_OBSERVER(Observer, 39 FOR_EACH_OBSERVER(Observer,
40 observer_list_, 40 observer_list_,
41 GoogleSigninSucceeded(username, username, std::string())); 41 GoogleSigninSucceeded(username, username, std::string()));
42 } 42 }
43 43
44 void FakeSigninManager::SignOut( 44 void FakeSigninManager::SignOut(
45 signin_metrics::ProfileSignout signout_source_metric) { 45 signin_metrics::ProfileSignout signout_source_metric) {
46 const std::string account_id = GetAuthenticatedAccountId(); 46 const std::string account_id = GetAuthenticatedAccountId();
47 const std::string username = GetAuthenticatedUsername(); 47 const std::string username = GetAuthenticatedUsername();
48 clear_authenticated_username(); 48 ClearAuthenticatedUsername();
49 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername); 49 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername);
50 FOR_EACH_OBSERVER(Observer, 50 FOR_EACH_OBSERVER(Observer,
51 observer_list_, 51 observer_list_,
52 GoogleSignedOut(account_id, username)); 52 GoogleSignedOut(account_id, username));
53 } 53 }
54 54
55 // static 55 // static
56 KeyedService* FakeSigninManager::Build(content::BrowserContext* context) { 56 KeyedService* FakeSigninManager::Build(content::BrowserContext* context) {
57 return new FakeSigninManager(Profile::FromBrowserContext(context)); 57 return new FakeSigninManager(Profile::FromBrowserContext(context));
58 } 58 }
59 59
60 } // namespace gcm 60 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698