[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / chromeos / dbus / fake_shill_profile_client.h
blob8c33bfb263f20a7510024bb6221d5d1df8463a23
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 CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_
8 #include <map>
9 #include <string>
11 #include "base/basictypes.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/dbus/shill_manager_client.h"
14 #include "chromeos/dbus/shill_profile_client.h"
16 namespace chromeos {
18 // A stub implementation of ShillProfileClient.
19 class CHROMEOS_EXPORT FakeShillProfileClient :
20 public ShillProfileClient,
21 public ShillProfileClient::TestInterface {
22 public:
23 FakeShillProfileClient();
24 ~FakeShillProfileClient() override;
26 // ShillProfileClient overrides
27 void Init(dbus::Bus* bus) override;
28 void AddPropertyChangedObserver(
29 const dbus::ObjectPath& profile_path,
30 ShillPropertyChangedObserver* observer) override;
31 void RemovePropertyChangedObserver(
32 const dbus::ObjectPath& profile_path,
33 ShillPropertyChangedObserver* observer) override;
34 void GetProperties(const dbus::ObjectPath& profile_path,
35 const DictionaryValueCallbackWithoutStatus& callback,
36 const ErrorCallback& error_callback) override;
37 void GetEntry(const dbus::ObjectPath& profile_path,
38 const std::string& entry_path,
39 const DictionaryValueCallbackWithoutStatus& callback,
40 const ErrorCallback& error_callback) override;
41 void DeleteEntry(const dbus::ObjectPath& profile_path,
42 const std::string& entry_path,
43 const base::Closure& callback,
44 const ErrorCallback& error_callback) override;
45 ShillProfileClient::TestInterface* GetTestInterface() override;
47 // ShillProfileClient::TestInterface overrides.
48 void AddProfile(const std::string& profile_path,
49 const std::string& userhash) override;
50 void AddEntry(const std::string& profile_path,
51 const std::string& entry_path,
52 const base::DictionaryValue& properties) override;
53 bool AddService(const std::string& profile_path,
54 const std::string& service_path) override;
55 bool UpdateService(const std::string& profile_path,
56 const std::string& service_path) override;
57 void GetProfilePaths(std::vector<std::string>* profiles) override;
58 bool GetService(const std::string& service_path,
59 std::string* profile_path,
60 base::DictionaryValue* properties) override;
61 void ClearProfiles() override;
63 private:
64 struct ProfileProperties;
65 typedef std::map<std::string, ProfileProperties*> ProfileMap;
67 bool AddOrUpdateServiceImpl(const std::string& profile_path,
68 const std::string& service_path,
69 ProfileProperties* profile);
71 ProfileProperties* GetProfile(const dbus::ObjectPath& profile_path,
72 const ErrorCallback& error_callback);
74 // The values are owned by this class and are explicitly destroyed where
75 // necessary.
76 ProfileMap profiles_;
78 DISALLOW_COPY_AND_ASSIGN(FakeShillProfileClient);
81 } // namespace chromeos
83 #endif // CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_