fake_oauth2_token_service.h revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_H_ 6#define GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_H_ 7 8#include <string> 9 10#include "base/compiler_specific.h" 11#include "google_apis/gaia/oauth2_token_service.h" 12 13namespace net { 14class URLRequestContextGetter; 15} 16 17// Do-nothing implementation of OAuth2TokenService. 18class FakeOAuth2TokenService : public OAuth2TokenService { 19 public: 20 FakeOAuth2TokenService(); 21 virtual ~FakeOAuth2TokenService(); 22 23 protected: 24 // OAuth2TokenService overrides. 25 virtual void FetchOAuth2Token(RequestImpl* request, 26 const std::string& account_id, 27 net::URLRequestContextGetter* getter, 28 const std::string& client_id, 29 const std::string& client_secret, 30 const ScopeSet& scopes) OVERRIDE; 31 32 virtual void InvalidateOAuth2Token(const std::string& account_id, 33 const std::string& client_id, 34 const ScopeSet& scopes, 35 const std::string& access_token) OVERRIDE; 36 37 virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE; 38 39 private: 40 // OAuth2TokenService overrides. 41 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 42 43 DISALLOW_COPY_AND_ASSIGN(FakeOAuth2TokenService); 44}; 45 46#endif // GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_H_ 47