OLD | NEW |
| (Empty) |
1 // Copyright (c) 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 CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_STUB_H_ | |
6 #define CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_STUB_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "chromeos/dbus/shill_manager_client.h" | |
13 #include "chromeos/dbus/shill_profile_client.h" | |
14 | |
15 namespace chromeos { | |
16 | |
17 // A stub implementation of ShillProfileClient. | |
18 class ShillProfileClientStub : public ShillProfileClient, | |
19 public ShillProfileClient::TestInterface { | |
20 public: | |
21 ShillProfileClientStub(); | |
22 virtual ~ShillProfileClientStub(); | |
23 | |
24 // ShillProfileClient overrides | |
25 virtual void Init(dbus::Bus* bus) OVERRIDE; | |
26 virtual void AddPropertyChangedObserver( | |
27 const dbus::ObjectPath& profile_path, | |
28 ShillPropertyChangedObserver* observer) OVERRIDE; | |
29 virtual void RemovePropertyChangedObserver( | |
30 const dbus::ObjectPath& profile_path, | |
31 ShillPropertyChangedObserver* observer) OVERRIDE; | |
32 virtual void GetProperties( | |
33 const dbus::ObjectPath& profile_path, | |
34 const DictionaryValueCallbackWithoutStatus& callback, | |
35 const ErrorCallback& error_callback) OVERRIDE; | |
36 virtual void GetEntry(const dbus::ObjectPath& profile_path, | |
37 const std::string& entry_path, | |
38 const DictionaryValueCallbackWithoutStatus& callback, | |
39 const ErrorCallback& error_callback) OVERRIDE; | |
40 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, | |
41 const std::string& entry_path, | |
42 const base::Closure& callback, | |
43 const ErrorCallback& error_callback) OVERRIDE; | |
44 virtual ShillProfileClient::TestInterface* GetTestInterface() OVERRIDE; | |
45 | |
46 // ShillProfileClient::TestInterface overrides. | |
47 virtual void AddProfile(const std::string& profile_path, | |
48 const std::string& userhash) OVERRIDE; | |
49 virtual void AddEntry(const std::string& profile_path, | |
50 const std::string& entry_path, | |
51 const base::DictionaryValue& properties) OVERRIDE; | |
52 virtual bool AddService(const std::string& profile_path, | |
53 const std::string& service_path) OVERRIDE; | |
54 virtual void GetProfilePaths(std::vector<std::string>* profiles) OVERRIDE; | |
55 | |
56 private: | |
57 struct ProfileProperties; | |
58 typedef std::map<std::string, ProfileProperties*> ProfileMap; | |
59 | |
60 ProfileProperties* GetProfile(const dbus::ObjectPath& profile_path, | |
61 const ErrorCallback& error_callback); | |
62 | |
63 // The values are owned by this class and are explicitly destroyed where | |
64 // necessary. | |
65 ProfileMap profiles_; | |
66 | |
67 DISALLOW_COPY_AND_ASSIGN(ShillProfileClientStub); | |
68 }; | |
69 | |
70 } // namespace chromeos | |
71 | |
72 #endif // CHROMEOS_DBUS_SHILL_PROFILE_CLIENT_STUB_H_ | |
OLD | NEW |