Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: chromeos/dbus/fake_shill_profile_client.h

Issue 2754903002: Prevent networkingPrivate.forgetNetwork from removing shared configs (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_ 6 #define CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_
7 7
8 #include <map>
9 #include <memory> 8 #include <memory>
10 #include <string> 9 #include <string>
10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chromeos/chromeos_export.h" 13 #include "chromeos/chromeos_export.h"
14 #include "chromeos/dbus/shill_manager_client.h" 14 #include "chromeos/dbus/shill_manager_client.h"
15 #include "chromeos/dbus/shill_profile_client.h" 15 #include "chromeos/dbus/shill_profile_client.h"
16 16
17 namespace chromeos { 17 namespace chromeos {
18 18
19 // A stub implementation of ShillProfileClient. 19 // A stub implementation of ShillProfileClient.
20 class CHROMEOS_EXPORT FakeShillProfileClient : 20 class CHROMEOS_EXPORT FakeShillProfileClient :
(...skipping 28 matching lines...) Expand all
49 void AddProfile(const std::string& profile_path, 49 void AddProfile(const std::string& profile_path,
50 const std::string& userhash) override; 50 const std::string& userhash) override;
51 void AddEntry(const std::string& profile_path, 51 void AddEntry(const std::string& profile_path,
52 const std::string& entry_path, 52 const std::string& entry_path,
53 const base::DictionaryValue& properties) override; 53 const base::DictionaryValue& properties) override;
54 bool AddService(const std::string& profile_path, 54 bool AddService(const std::string& profile_path,
55 const std::string& service_path) override; 55 const std::string& service_path) override;
56 bool UpdateService(const std::string& profile_path, 56 bool UpdateService(const std::string& profile_path,
57 const std::string& service_path) override; 57 const std::string& service_path) override;
58 void GetProfilePaths(std::vector<std::string>* profiles) override; 58 void GetProfilePaths(std::vector<std::string>* profiles) override;
59 void GetProfilePathsContainingService(
60 const std::string& service_path,
61 std::vector<std::string>* profiles) override;
59 bool GetService(const std::string& service_path, 62 bool GetService(const std::string& service_path,
60 std::string* profile_path, 63 std::string* profile_path,
61 base::DictionaryValue* properties) override; 64 base::DictionaryValue* properties) override;
62 void ClearProfiles() override; 65 void ClearProfiles() override;
63 66
64 private: 67 private:
65 struct ProfileProperties; 68 struct ProfileProperties;
66 using ProfileMap = std::map<std::string, std::unique_ptr<ProfileProperties>>;
67 69
68 bool AddOrUpdateServiceImpl(const std::string& profile_path, 70 bool AddOrUpdateServiceImpl(const std::string& profile_path,
69 const std::string& service_path, 71 const std::string& service_path,
70 ProfileProperties* profile); 72 ProfileProperties* profile);
71 73
72 ProfileProperties* GetProfile(const dbus::ObjectPath& profile_path, 74 ProfileProperties* GetProfile(const dbus::ObjectPath& profile_path,
73 const ErrorCallback& error_callback); 75 const ErrorCallback& error_callback);
74 76
75 ProfileMap profiles_; 77 bool GetServiceDataFromProfile(const ProfileProperties* profile,
78 const std::string& service_path,
79 base::DictionaryValue* properties);
80
81 // List of profiles known to the client in order they were added, and in the
82 // reverse order of priority.
83 // |AddProfile| will encure that shared profile is never added after a user
84 // profile.
85 std::vector<std::unique_ptr<ProfileProperties>> profiles_;
76 86
77 DISALLOW_COPY_AND_ASSIGN(FakeShillProfileClient); 87 DISALLOW_COPY_AND_ASSIGN(FakeShillProfileClient);
78 }; 88 };
79 89
80 } // namespace chromeos 90 } // namespace chromeos
81 91
82 #endif // CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_ 92 #endif // CHROMEOS_DBUS_FAKE_SHILL_PROFILE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698