blob: 28d46d940a5ec09821df588441d2b3c515978831 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// 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.
#ifndef GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_
#define GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "google_apis/gaia/identity_provider.h"
class OAuth2TokenService;
// Fake identity provider implementation.
class FakeIdentityProvider : public IdentityProvider {
public:
explicit FakeIdentityProvider(OAuth2TokenService* token_service);
virtual ~FakeIdentityProvider();
void LogIn(const std::string& account_id);
void LogOut();
// IdentityProvider:
virtual std::string GetActiveUsername() OVERRIDE;
virtual std::string GetActiveAccountId() OVERRIDE;
virtual OAuth2TokenService* GetTokenService() OVERRIDE;
virtual bool RequestLogin() OVERRIDE;
private:
std::string account_id_;
OAuth2TokenService* token_service_;
DISALLOW_COPY_AND_ASSIGN(FakeIdentityProvider);
};
#endif // GOOGLE_APIS_GAIA_FAKE_IDENTITY_PROVIDER_H_
|