Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / app_list / test / fake_profile_store.h
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.
4
5 #ifndef CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
7
8 #include <map>
9
10 #include "base/callback.h"
11 #include "base/observer_list.h"
12 #include "chrome/browser/ui/app_list/profile_store.h"
13
14 class FakeProfileStore : public ProfileStore {
15  public:
16   explicit FakeProfileStore(const base::FilePath& user_data_dir);
17   ~FakeProfileStore() override;
18
19   void LoadProfile(Profile* profile);
20   void RemoveProfile(Profile* profile);
21
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;
29
30  private:
31   base::FilePath user_data_dir_;
32   typedef std::map<base::FilePath, base::Callback<void(Profile*)> >
33       CallbacksByPath;
34   CallbacksByPath callbacks_;
35   ObserverList<ProfileInfoCacheObserver> observer_list_;
36   typedef std::map<base::FilePath, Profile*> ProfilesByPath;
37   ProfilesByPath loaded_profiles_;
38 };
39
40 #endif  // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_