1 // Copyright 2013 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_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
10 #include "base/callback.h"
11 #include "base/observer_list.h"
12 #include "chrome/browser/ui/app_list/profile_store.h"
14 class FakeProfileStore : public ProfileStore {
16 explicit FakeProfileStore(const base::FilePath& user_data_dir);
17 ~FakeProfileStore() override;
19 void LoadProfile(Profile* profile);
20 void RemoveProfile(Profile* profile);
22 // ProfileStore overrides.
23 void AddProfileObserver(ProfileInfoCacheObserver* observer) override;
24 void LoadProfileAsync(const base::FilePath& path,
25 base::Callback<void(Profile*)> callback) override;
26 Profile* GetProfileByPath(const base::FilePath& path) override;
27 base::FilePath GetUserDataDir() override;
28 bool IsProfileSupervised(const base::FilePath& path) override;
31 base::FilePath user_data_dir_;
32 typedef std::map<base::FilePath, base::Callback<void(Profile*)> >
34 CallbacksByPath callbacks_;
35 ObserverList<ProfileInfoCacheObserver> observer_list_;
36 typedef std::map<base::FilePath, Profile*> ProfilesByPath;
37 ProfilesByPath loaded_profiles_;
40 #endif // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_