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

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

Issue 136723009: Move UbertokenFetcher from //chrome to //google_apis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « chrome/browser/signin/ubertoken_fetcher.h ('k') | chrome/browser/signin/ubertoken_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/ubertoken_fetcher.cc
diff --git a/chrome/browser/signin/ubertoken_fetcher.cc b/chrome/browser/signin/ubertoken_fetcher.cc
deleted file mode 100644
index ef195915c58267be52d6bc338710891be2d7fe6d..0000000000000000000000000000000000000000
--- a/chrome/browser/signin/ubertoken_fetcher.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 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/ubertoken_fetcher.h"
-
-#include <vector>
-
-#include "base/logging.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/profile_oauth2_token_service.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
-#include "google_apis/gaia/gaia_auth_fetcher.h"
-#include "google_apis/gaia/gaia_constants.h"
-#include "google_apis/gaia/gaia_urls.h"
-#include "google_apis/gaia/google_service_auth_error.h"
-#include "google_apis/gaia/oauth2_token_service.h"
-
-UbertokenFetcher::UbertokenFetcher(Profile* profile,
- UbertokenConsumer* consumer)
- : OAuth2TokenService::Consumer("uber_token_fetcher"),
- profile_(profile), consumer_(consumer) {
- DCHECK(profile);
- DCHECK(consumer);
-}
-
-UbertokenFetcher::~UbertokenFetcher() {
-}
-
-void UbertokenFetcher::StartFetchingToken(const std::string& account_id) {
- OAuth2TokenService::ScopeSet scopes;
- scopes.insert(GaiaUrls::GetInstance()->oauth1_login_scope());
- OAuth2TokenService* token_service =
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
- access_token_request_ = token_service->StartRequest(account_id, scopes, this);
-}
-
-void UbertokenFetcher::OnUberAuthTokenSuccess(const std::string& token) {
- consumer_->OnUbertokenSuccess(token);
-}
-
-void UbertokenFetcher::OnUberAuthTokenFailure(
- const GoogleServiceAuthError& error) {
- consumer_->OnUbertokenFailure(error);
-}
-
-void UbertokenFetcher::OnGetTokenSuccess(
- const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) {
- access_token_request_.reset();
- gaia_auth_fetcher_.reset(new GaiaAuthFetcher(this,
- GaiaConstants::kChromeSource,
- profile_->GetRequestContext()));
- gaia_auth_fetcher_->StartTokenFetchForUberAuthExchange(access_token);
-}
-
-void UbertokenFetcher::OnGetTokenFailure(
- const OAuth2TokenService::Request* request,
- const GoogleServiceAuthError& error) {
- access_token_request_.reset();
- consumer_->OnUbertokenFailure(error);
-}
« no previous file with comments | « chrome/browser/signin/ubertoken_fetcher.h ('k') | chrome/browser/signin/ubertoken_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698