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
14class FakeProfileStore : public ProfileStore {
15 public:
16  explicit FakeProfileStore(const base::FilePath& user_data_dir);
17  virtual ~FakeProfileStore();
18
19  void LoadProfile(Profile* profile);
20  void RemoveProfile(Profile* profile);
21
22  // ProfileStore overrides.
23  virtual void AddProfileObserver(ProfileInfoCacheObserver* observer) OVERRIDE;
24  virtual void LoadProfileAsync(
25      const base::FilePath& path,
26      base::Callback<void(Profile*)> callback) OVERRIDE;
27  virtual Profile* GetProfileByPath(const base::FilePath& path) OVERRIDE;
28  virtual base::FilePath GetUserDataDir() OVERRIDE;
29  virtual bool IsProfileSupervised(const base::FilePath& path) OVERRIDE;
30
31 private:
32  base::FilePath user_data_dir_;
33  typedef std::map<base::FilePath, base::Callback<void(Profile*)> >
34      CallbacksByPath;
35  CallbacksByPath callbacks_;
36  ObserverList<ProfileInfoCacheObserver> observer_list_;
37  typedef std::map<base::FilePath, Profile*> ProfilesByPath;
38  ProfilesByPath loaded_profiles_;
39};
40
41#endif  // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
42