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

Unified Diff: google_apis/gaia/dummy_identity_provider.cc

Issue 301973009: Add browser-global GCMDriver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build on Android. Created 6 years, 6 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 | « google_apis/gaia/dummy_identity_provider.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/dummy_identity_provider.cc
diff --git a/google_apis/gaia/dummy_identity_provider.cc b/google_apis/gaia/dummy_identity_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..50991754b04e2d3d559af5ba82e6a1493fcaba60
--- /dev/null
+++ b/google_apis/gaia/dummy_identity_provider.cc
@@ -0,0 +1,93 @@
+// Copyright 2014 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 "google_apis/gaia/dummy_identity_provider.h"
+
+#include <string>
+
+#include "google_apis/gaia/oauth2_token_service.h"
+
+class DummyIdentityProvider::DummyOAuth2TokenService
+ : public OAuth2TokenService {
+ public:
+ DummyOAuth2TokenService();
+ virtual ~DummyOAuth2TokenService();
+
+ // OAuth2TokenService:
+ virtual bool RefreshTokenIsAvailable(
+ const std::string& account_id) const OVERRIDE;
+ virtual void FetchOAuth2Token(RequestImpl* request,
+ const std::string& account_id,
+ net::URLRequestContextGetter* getter,
+ const std::string& client_id,
+ const std::string& client_secret,
+ const ScopeSet& scopes) OVERRIDE;
+ virtual OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
+ const std::string& account_id,
+ net::URLRequestContextGetter* getter,
+ OAuth2AccessTokenConsumer* consumer) OVERRIDE;
+
+ private:
+ virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
+
+ DISALLOW_COPY_AND_ASSIGN(DummyOAuth2TokenService);
+};
+
+
+DummyIdentityProvider::DummyOAuth2TokenService::DummyOAuth2TokenService() {
+}
+
+DummyIdentityProvider::DummyOAuth2TokenService::~DummyOAuth2TokenService() {
+}
+
+bool DummyIdentityProvider::DummyOAuth2TokenService::RefreshTokenIsAvailable(
+ const std::string& account_id) const {
+ return false;
+}
+
+void DummyIdentityProvider::DummyOAuth2TokenService::FetchOAuth2Token(
+ RequestImpl* request,
+ const std::string& account_id,
+ net::URLRequestContextGetter* getter,
+ const std::string& client_id,
+ const std::string& client_secret,
+ const ScopeSet& scopes) {
+ // Ignore the fetch request.
+}
+
+OAuth2AccessTokenFetcher*
+DummyIdentityProvider::DummyOAuth2TokenService::CreateAccessTokenFetcher(
+ const std::string& account_id,
+ net::URLRequestContextGetter* getter,
+ OAuth2AccessTokenConsumer* consumer) {
+ return NULL;
+}
+
+net::URLRequestContextGetter*
+DummyIdentityProvider::DummyOAuth2TokenService::GetRequestContext() {
+ return NULL;
+}
+
+DummyIdentityProvider::DummyIdentityProvider()
+ : oauth2_token_service_(new DummyOAuth2TokenService) {
+}
+
+DummyIdentityProvider::~DummyIdentityProvider() {
+}
+
+std::string DummyIdentityProvider::GetActiveUsername() {
+ return std::string();
+}
+
+std::string DummyIdentityProvider::GetActiveAccountId() {
+ return std::string();
+}
+
+OAuth2TokenService* DummyIdentityProvider::GetTokenService() {
+ return oauth2_token_service_.get();
+}
+
+bool DummyIdentityProvider::RequestLogin() {
+ return false;
+}
« no previous file with comments | « google_apis/gaia/dummy_identity_provider.h ('k') | google_apis/google_apis.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698