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