Fire an error if a pref used in the UI is missing once all prefs are fetched.
[chromium-blink-merge.git] / chrome / browser / signin / fake_account_tracker_service.cc
blobc592b1ad0d56afcc1cfa2e43bce232d88cd9b697
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 #include "chrome/browser/signin/fake_account_tracker_service.h"
7 #include "base/values.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/chrome_signin_client_factory.h"
10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
11 #include "components/signin/core/browser/profile_oauth2_token_service.h"
13 // static
14 KeyedService* FakeAccountTrackerService::Build(
15 content::BrowserContext* context) {
16 Profile* profile = Profile::FromBrowserContext(context);
17 FakeAccountTrackerService* service = new FakeAccountTrackerService();
18 service->Initialize(
19 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
20 ChromeSigninClientFactory::GetForProfile(profile));
21 return service;
24 FakeAccountTrackerService::FakeAccountTrackerService() {}
26 FakeAccountTrackerService::~FakeAccountTrackerService() {}
28 void FakeAccountTrackerService::StartFetchingUserInfo(
29 const std::string& account_id) {
30 // In tests, don't do actual network fetch.
33 void FakeAccountTrackerService::FakeUserInfoFetchSuccess(
34 const std::string& account_id,
35 const std::string& email,
36 const std::string& gaia,
37 const std::string& hosted_domain) {
38 base::DictionaryValue user_info;
39 user_info.SetString("id", gaia);
40 user_info.SetString("email", email);
41 user_info.SetString("hd", hosted_domain);
42 SetAccountStateFromUserInfo(account_id, &user_info);
45 void FakeAccountTrackerService::SendRefreshTokenAnnotationRequest(
46 const std::string& account_id) {
47 // In tests, don't do actual network fetch.