Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / signin / core / browser / fake_account_fetcher_service.h
blobfb5d13ff1798996b1f00dfe5d1c46e8e81e4ea77
1 // Copyright 2015 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 COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_ACCOUNT_FETCHER_SERVICE_H_
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_ACCOUNT_FETCHER_SERVICE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/signin/core/browser/account_fetcher_service.h"
11 class KeyedService;
13 namespace content {
14 class BrowserContext;
17 // AccountTrackerService is a KeyedService that retrieves and caches GAIA
18 // information about Google Accounts. This fake class can be used in tests
19 // to prevent AccountTrackerService from sending network requests.
20 class FakeAccountFetcherService : public AccountFetcherService {
21 public:
22 void FakeUserInfoFetchSuccess(const std::string& email,
23 const std::string& gaia,
24 const std::string& hosted_domain,
25 const std::string& full_name,
26 const std::string& given_name,
27 const std::string& locale,
28 const std::string& picture_url);
29 void FakeUserInfoFetchSuccess(const std::string& account_id,
30 const std::string& email,
31 const std::string& gaia,
32 const std::string& hosted_domain,
33 const std::string& full_name,
34 const std::string& given_name,
35 const std::string& locale,
36 const std::string& picture_url);
37 void FakeSetIsChildAccount(const std::string& account_id,
38 const bool& is_child_account);
40 FakeAccountFetcherService();
42 private:
43 void StartFetchingUserInfo(const std::string& account_id) override;
44 void StartFetchingChildInfo(const std::string& account_id) override;
45 void SendRefreshTokenAnnotationRequest(
46 const std::string& account_id) override;
48 DISALLOW_COPY_AND_ASSIGN(FakeAccountFetcherService);
51 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_ACCOUNT_FETCHER_SERVICE_H_