| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/login/oauth_login_manager.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "chrome/browser/chromeos/login/oauth2_login_manager.h" | |
| 9 #include "chrome/browser/profiles/profile.h" | |
| 10 #include "chrome/browser/signin/token_service.h" | |
| 11 #include "chrome/browser/signin/token_service_factory.h" | |
| 12 #include "chrome/common/chrome_switches.h" | |
| 13 #include "content/public/browser/browser_thread.h" | |
| 14 | |
| 15 using content::BrowserThread; | |
| 16 | |
| 17 namespace chromeos { | |
| 18 | |
| 19 // OAuthLoginManager. | |
| 20 | |
| 21 // static. | |
| 22 OAuthLoginManager* OAuthLoginManager::Create( | |
| 23 OAuthLoginManager::Delegate* delegate) { | |
| 24 return new OAuth2LoginManager(delegate); | |
| 25 } | |
| 26 | |
| 27 void OAuthLoginManager::CompleteAuthentication() { | |
| 28 delegate_->OnCompletedAuthentication(user_profile_); | |
| 29 TokenService* token_service = | |
| 30 TokenServiceFactory::GetForProfile(user_profile_); | |
| 31 if (token_service->AreCredentialsValid()) | |
| 32 token_service->StartFetchingTokens(); | |
| 33 } | |
| 34 | |
| 35 OAuthLoginManager::OAuthLoginManager(Delegate* delegate) | |
| 36 : delegate_(delegate), | |
| 37 user_profile_(NULL), | |
| 38 restore_strategy_(RESTORE_FROM_COOKIE_JAR), | |
| 39 state_(SESSION_RESTORE_NOT_STARTED) { | |
| 40 } | |
| 41 | |
| 42 OAuthLoginManager::~OAuthLoginManager() { | |
| 43 } | |
| 44 | |
| 45 } // namespace chromeos | |
| OLD | NEW |