diff options
Diffstat (limited to 'chromium/google_apis/gaia/fake_identity_provider.h')
-rw-r--r-- | chromium/google_apis/gaia/fake_identity_provider.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/chromium/google_apis/gaia/fake_identity_provider.h b/chromium/google_apis/gaia/fake_identity_provider.h new file mode 100644 index 00000000000..28d46d940a5 --- /dev/null +++ b/chromium/google_apis/gaia/fake_identity_provider.h @@ -0,0 +1,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_ |