OLD | NEW |
---|---|
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/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 // 'if' statement with a CHECK(delegate_) once the underlying issue is | 853 // 'if' statement with a CHECK(delegate_) once the underlying issue is |
854 // resolved. | 854 // resolved. |
855 if (delegate_) | 855 if (delegate_) |
856 delegate_->OnProfilePrepared(user_profile); | 856 delegate_->OnProfilePrepared(user_profile); |
857 | 857 |
858 // TODO(altimofeev): Need to sanitize memory used to store password. | 858 // TODO(altimofeev): Need to sanitize memory used to store password. |
859 credentials_ = GaiaAuthConsumer::ClientLoginResult(); | 859 credentials_ = GaiaAuthConsumer::ClientLoginResult(); |
860 } | 860 } |
861 | 861 |
862 void LoginUtilsImpl::FetchOAuth1AccessToken(Profile* auth_profile) { | 862 void LoginUtilsImpl::FetchOAuth1AccessToken(Profile* auth_profile) { |
863 VLOG(1) << "Start fetch oauth1 access token."; | |
zel
2012/01/21 00:54:22
remove this
xiyuan
2012/01/21 16:48:42
Done.
| |
863 oauth_fetcher_.reset(new GaiaOAuthFetcher(this, | 864 oauth_fetcher_.reset(new GaiaOAuthFetcher(this, |
864 auth_profile->GetRequestContext(), | 865 auth_profile->GetRequestContext(), |
865 auth_profile, | 866 auth_profile, |
866 kServiceScopeChromeOS)); | 867 kServiceScopeChromeOS)); |
867 // Let's first get the Oauth request token and OAuth1 token+secret. | 868 // Let's first get the Oauth request token and OAuth1 token+secret. |
868 // Once we get that, we will kick off individual requests for OAuth2 tokens | 869 // Once we get that, we will kick off individual requests for OAuth2 tokens |
869 // for all our services. | 870 // for all our services. |
870 oauth_fetcher_->SetAutoFetchLimit(GaiaOAuthFetcher::OAUTH1_ALL_ACCESS_TOKEN); | 871 oauth_fetcher_->SetAutoFetchLimit(GaiaOAuthFetcher::OAUTH1_ALL_ACCESS_TOKEN); |
871 oauth_fetcher_->StartGetOAuthTokenRequest(); | 872 oauth_fetcher_->StartGetOAuthTokenRequest(); |
872 } | 873 } |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1353 bool LoginUtils::IsWhitelisted(const std::string& username) { | 1354 bool LoginUtils::IsWhitelisted(const std::string& username) { |
1354 CrosSettings* cros_settings = CrosSettings::Get(); | 1355 CrosSettings* cros_settings = CrosSettings::Get(); |
1355 bool allow_new_user = false; | 1356 bool allow_new_user = false; |
1356 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 1357 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
1357 if (allow_new_user) | 1358 if (allow_new_user) |
1358 return true; | 1359 return true; |
1359 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 1360 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); |
1360 } | 1361 } |
1361 | 1362 |
1362 } // namespace chromeos | 1363 } // namespace chromeos |
OLD | NEW |