Support policy registration using a preobtained access token.
[chromium-blink-merge.git] / google_apis / gaia / fake_identity_provider.h
blob28d46d940a5ec09821df588441d2b3c515978831
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.
5 #ifndef GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_
6 #define GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "base/macros.h"
12 #include "google_apis/gaia/identity_provider.h"
14 class OAuth2TokenService;
16 // Fake identity provider implementation.
17 class FakeIdentityProvider : public IdentityProvider {
18 public:
19 explicit FakeIdentityProvider(OAuth2TokenService* token_service);
20 virtual ~FakeIdentityProvider();
22 void LogIn(const std::string& account_id);
23 void LogOut();
25 // IdentityProvider:
26 virtual std::string GetActiveUsername() OVERRIDE;
27 virtual std::string GetActiveAccountId() OVERRIDE;
28 virtual OAuth2TokenService* GetTokenService() OVERRIDE;
29 virtual bool RequestLogin() OVERRIDE;
31 private:
32 std::string account_id_;
33 OAuth2TokenService* token_service_;
35 DISALLOW_COPY_AND_ASSIGN(FakeIdentityProvider);
38 #endif // GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_