OLD | NEW |
(Empty) | |
| 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_DUMMY_IDENTITY_PROVIDER_H_ |
| 6 #define GOOGLE_APIS_GAIA_DUMMY_IDENTITY_PROVIDER_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "google_apis/gaia/identity_provider.h" |
| 12 |
| 13 // GCMDriver depends on IdentityProvider as it was originally meant to work for |
| 14 // signed-in users only. This dependency is being removed. While it is still |
| 15 // present, DummyIdentityProvider will be used for the browser-global GCMDriver |
| 16 // instance. The DummyIdentityProvider never has any active user or tokens. |
| 17 // TODO(bartfab,jianli): Remove this class when GCMDriver no longer depends on |
| 18 // IdentityService. |
| 19 class DummyIdentityProvider : public IdentityProvider { |
| 20 public: |
| 21 DummyIdentityProvider(); |
| 22 virtual ~DummyIdentityProvider(); |
| 23 |
| 24 // IdentityProvider: |
| 25 virtual std::string GetActiveUsername() OVERRIDE; |
| 26 virtual std::string GetActiveAccountId() OVERRIDE; |
| 27 virtual OAuth2TokenService* GetTokenService() OVERRIDE; |
| 28 virtual bool RequestLogin() OVERRIDE; |
| 29 |
| 30 private: |
| 31 class DummyOAuth2TokenService; |
| 32 |
| 33 scoped_ptr<DummyOAuth2TokenService> oauth2_token_service_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(DummyIdentityProvider); |
| 36 }; |
| 37 |
| 38 #endif // GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_ |
OLD | NEW |