[Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions.
[chromium-blink-merge.git] / chrome / browser / signin / fake_account_tracker_service.h
blob5008d512c86cfd3cc5f4214c0a38b8a0cf04841a
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 CHROME_BROWSER_SIGNIN_FAKE_ACCOUNT_TRACKER_SERVICE_H_
6 #define CHROME_BROWSER_SIGNIN_FAKE_ACCOUNT_TRACKER_SERVICE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "components/signin/core/browser/account_tracker_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 FakeAccountTrackerService : public AccountTrackerService {
21 public:
22 static scoped_ptr<KeyedService> Build(content::BrowserContext* context);
24 void FakeUserInfoFetchSuccess(const std::string& email,
25 const std::string& gaia,
26 const std::string& hosted_domain,
27 const std::string& full_name,
28 const std::string& given_name,
29 const std::string& locale,
30 const std::string& picture_url);
32 private:
33 FakeAccountTrackerService();
34 ~FakeAccountTrackerService() override;
36 void StartFetchingUserInfo(const std::string& account_id) override;
37 void SendRefreshTokenAnnotationRequest(
38 const std::string& account_id) override;
40 DISALLOW_COPY_AND_ASSIGN(FakeAccountTrackerService);
43 #endif // CHROME_BROWSER_SIGNIN_FAKE_ACCOUNT_TRACKER_SERVICE_H_