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

Unified Diff: chrome/browser/signin/signin_oauth_helper.cc

Issue 219933002: Componentize AccountReconcilor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
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);
-}

Powered by Google App Engine
This is Rietveld 408576698