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#include "google_apis/gaia/fake_identity_provider.h"
6
7#include "google_apis/gaia/oauth2_token_service.h"
8
9FakeIdentityProvider::FakeIdentityProvider(OAuth2TokenService* token_service)
10    : token_service_(token_service) {
11}
12
13FakeIdentityProvider::~FakeIdentityProvider() {
14}
15
16void FakeIdentityProvider::LogIn(const std::string& account_id) {
17  account_id_ = account_id;
18  FireOnActiveAccountLogin();
19}
20
21void FakeIdentityProvider::LogOut() {
22  account_id_.clear();
23  FireOnActiveAccountLogout();
24}
25
26std::string FakeIdentityProvider::GetActiveUsername() {
27  return account_id_;
28}
29
30std::string FakeIdentityProvider::GetActiveAccountId() {
31  return account_id_;
32}
33
34OAuth2TokenService* FakeIdentityProvider::GetTokenService() {
35  return token_service_;
36}
37
38bool FakeIdentityProvider::RequestLogin() {
39  return false;
40}
41