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

Unified Diff: chrome/browser/sync/fake_oauth2_token_service.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
Index: chrome/browser/sync/fake_oauth2_token_service.cc
diff --git a/chrome/browser/sync/fake_oauth2_token_service.cc b/chrome/browser/sync/fake_oauth2_token_service.cc
deleted file mode 100644
index 6ce1a6cc3ee7271f7d8938a83aee5cdf0abe796e..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/fake_oauth2_token_service.cc
+++ /dev/null
@@ -1,47 +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/sync/fake_oauth2_token_service.h"
-
-#include "base/message_loop/message_loop.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/browser_context.h"
-
-void FakeOAuth2TokenService::FetchOAuth2Token(
- OAuth2TokenService::RequestImpl* request,
- const std::string& account_id,
- net::URLRequestContextGetter* getter,
- const std::string& client_id,
- const std::string& client_secret,
- const OAuth2TokenService::ScopeSet& scopes) {
- // Request will succeed without network IO.
- base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- &RequestImpl::InformConsumer,
- request->AsWeakPtr(),
- GoogleServiceAuthError(GoogleServiceAuthError::NONE),
- "access_token",
- base::Time::Max()));
-}
-
-void FakeOAuth2TokenService::UpdateCredentials(
- const std::string& account_id,
- const std::string& refresh_token) {
- account_id_ = account_id;
- refresh_token_ = refresh_token;
- FireRefreshTokenAvailable(account_id);
-}
-
-bool FakeOAuth2TokenService::RefreshTokenIsAvailable(
- const std::string& account_id) {
- return account_id_ == account_id && !refresh_token_.empty();
-}
-
-BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService(
- content::BrowserContext* context) {
- Profile* profile = static_cast<Profile*>(context);
-
- FakeOAuth2TokenService* service = new FakeOAuth2TokenService();
- service->Initialize(profile);
- return service;
-}
« no previous file with comments | « chrome/browser/sync/fake_oauth2_token_service.h ('k') | chrome/browser/sync/fake_oauth2_token_service_for_sync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698