| Index: chrome/browser/signin/signin_oauth_helper.cc
|
| diff --git a/chrome/browser/signin/signin_oauth_helper.cc b/chrome/browser/signin/signin_oauth_helper.cc
|
| deleted file mode 100644
|
| index 2c8790b1d8befa7436afb7ad363cc2acc2140b59..0000000000000000000000000000000000000000
|
| --- a/chrome/browser/signin/signin_oauth_helper.cc
|
| +++ /dev/null
|
| @@ -1,69 +0,0 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "chrome/browser/signin/signin_oauth_helper.h"
|
| -
|
| -#include "base/message_loop/message_loop.h"
|
| -#include "google_apis/gaia/gaia_auth_fetcher.h"
|
| -#include "google_apis/gaia/gaia_constants.h"
|
| -
|
| -SigninOAuthHelper::SigninOAuthHelper(net::URLRequestContextGetter* getter,
|
| - const std::string& session_index,
|
| - Consumer* consumer)
|
| - : gaia_auth_fetcher_(this, GaiaConstants::kChromeSource, getter),
|
| - consumer_(consumer) {
|
| - DCHECK(consumer_);
|
| - DCHECK(getter);
|
| - DCHECK(!session_index.empty());
|
| - gaia_auth_fetcher_.StartCookieForOAuthLoginTokenExchange(session_index);
|
| -}
|
| -
|
| -SigninOAuthHelper::~SigninOAuthHelper() {}
|
| -
|
| -void SigninOAuthHelper::OnClientOAuthSuccess(const ClientOAuthResult& result) {
|
| - refresh_token_ = result.refresh_token;
|
| - gaia_auth_fetcher_.StartOAuthLogin(result.access_token,
|
| - GaiaConstants::kGaiaService);
|
| -}
|
| -
|
| -void SigninOAuthHelper::OnClientOAuthFailure(
|
| - const GoogleServiceAuthError& error) {
|
| - VLOG(1) << "SigninOAuthHelper::OnClientOAuthFailure: " << error.ToString();
|
| - consumer_->OnSigninOAuthInformationFailure(error);
|
| -}
|
| -
|
| -void SigninOAuthHelper::OnClientLoginSuccess(const ClientLoginResult& result) {
|
| - gaia_auth_fetcher_.StartGetUserInfo(result.lsid);
|
| -}
|
| -
|
| -void SigninOAuthHelper::OnClientLoginFailure(
|
| - const GoogleServiceAuthError& error) {
|
| - VLOG(1) << "SigninOAuthHelper::OnClientLoginFailure: " << error.ToString();
|
| - consumer_->OnSigninOAuthInformationFailure(error);
|
| -}
|
| -
|
| -void SigninOAuthHelper::OnGetUserInfoSuccess(const UserInfoMap& data) {
|
| - UserInfoMap::const_iterator email_iter = data.find("email");
|
| - UserInfoMap::const_iterator display_email_iter = data.find("displayEmail");
|
| - if (email_iter == data.end() || display_email_iter == data.end()) {
|
| - VLOG(1) << "SigninOAuthHelper::OnGetUserInfoSuccess: no email found:"
|
| - << " email=" << email_iter->second
|
| - << " displayEmail=" << display_email_iter->second;
|
| - consumer_->OnSigninOAuthInformationFailure(
|
| - GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR));
|
| - } else {
|
| - VLOG(1) << "SigninOAuthHelper::OnGetUserInfoSuccess:"
|
| - << " email=" << email_iter->second
|
| - << " displayEmail=" << display_email_iter->second;
|
| - consumer_->OnSigninOAuthInformationAvailable(email_iter->second,
|
| - display_email_iter->second,
|
| - refresh_token_);
|
| - }
|
| -}
|
| -
|
| -void SigninOAuthHelper::OnGetUserInfoFailure(
|
| - const GoogleServiceAuthError& error) {
|
| - VLOG(1) << "SigninOAuthHelper::OnGetUserInfoFailure : " << error.ToString();
|
| - consumer_->OnSigninOAuthInformationFailure(error);
|
| -}
|
|
|