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

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

Issue 196783002: Export a private webstore API to call into the new inline sign-in flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add API tests Created 6 years, 8 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
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_tracker.h" 5 #include "chrome/browser/signin/signin_tracker.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/account_reconcilor_factory.h" 8 #include "chrome/browser/signin/account_reconcilor_factory.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 OAuth2TokenService* token_service = 49 OAuth2TokenService* token_service =
50 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); 50 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
51 token_service->AddObserver(this); 51 token_service->AddObserver(this);
52 } 52 }
53 53
54 void SigninTracker::GoogleSigninFailed(const GoogleServiceAuthError& error) { 54 void SigninTracker::GoogleSigninFailed(const GoogleServiceAuthError& error) {
55 observer_->SigninFailed(error); 55 observer_->SigninFailed(error);
56 } 56 }
57 57
58 void SigninTracker::OnRefreshTokenAvailable(const std::string& account_id) { 58 void SigninTracker::OnRefreshTokenAvailable(const std::string& account_id) {
59 DLOG(WARNING) << "SigninTracker::OnRefreshTokenAvailable()";
59 // TODO: when OAuth2TokenService handles multi-login, this should check 60 // TODO: when OAuth2TokenService handles multi-login, this should check
60 // that |account_id| is the primary account before signalling success. 61 // that |account_id| is the primary account before signalling success.
61 if (!switches::IsEnableWebBasedSignin()) { 62 if (!switches::IsEnableWebBasedSignin()) {
62 if (switches::IsNewProfileManagement()) { 63 if (switches::IsNewProfileManagement()) {
63 AccountReconcilorFactory::GetForProfile(profile_)-> 64 AccountReconcilorFactory::GetForProfile(profile_)->
64 AddMergeSessionObserver(this); 65 AddMergeSessionObserver(this);
65 #if !defined(OS_CHROMEOS) 66 #if !defined(OS_CHROMEOS)
66 } else { 67 } else {
67 SigninManagerFactory::GetForProfile(profile_)-> 68 SigninManagerFactory::GetForProfile(profile_)->
68 AddMergeSessionObserver(this); 69 AddMergeSessionObserver(this);
69 #endif 70 #endif
70 } 71 }
71 } 72 }
72 73
73 observer_->SigninSuccess(); 74 observer_->SigninSuccess();
74 } 75 }
75 76
76 void SigninTracker::OnRefreshTokenRevoked(const std::string& account_id) { 77 void SigninTracker::OnRefreshTokenRevoked(const std::string& account_id) {
77 NOTREACHED(); 78 NOTREACHED();
78 } 79 }
79 80
80 void SigninTracker::MergeSessionCompleted( 81 void SigninTracker::MergeSessionCompleted(
81 const std::string& account_id, 82 const std::string& account_id,
82 const GoogleServiceAuthError& error) { 83 const GoogleServiceAuthError& error) {
84 DLOG(WARNING) << "SigninTracker::MergeSessionCompleted()";
83 observer_->MergeSessionComplete(error); 85 observer_->MergeSessionComplete(error);
84 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698