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

Side by Side Diff: chromeos/network/network_configuration_handler.h

Issue 917053002: Add Source property to networkingPrivate.getState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with separated test expectations Created 5 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ 5 #ifndef CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
6 #define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ 6 #define CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 : public base::SupportsWeakPtr<NetworkConfigurationHandler> { 59 : public base::SupportsWeakPtr<NetworkConfigurationHandler> {
60 public: 60 public:
61 ~NetworkConfigurationHandler(); 61 ~NetworkConfigurationHandler();
62 62
63 // Manages the observer list. 63 // Manages the observer list.
64 void AddObserver(NetworkConfigurationObserver* observer); 64 void AddObserver(NetworkConfigurationObserver* observer);
65 void RemoveObserver(NetworkConfigurationObserver* observer); 65 void RemoveObserver(NetworkConfigurationObserver* observer);
66 66
67 // Gets the properties of the network with id |service_path|. See note on 67 // Gets the properties of the network with id |service_path|. See note on
68 // |callback| and |error_callback|, in class description above. 68 // |callback| and |error_callback|, in class description above.
69 void GetProperties( 69 void GetProperties(const std::string& service_path,
70 const std::string& service_path, 70 const network_handler::DictionaryResultCallback& callback,
71 const network_handler::DictionaryResultCallback& callback, 71 const network_handler::ErrorCallback& error_callback);
72 const network_handler::ErrorCallback& error_callback) const;
73 72
74 // Sets the properties of the network with id |service_path|. This means the 73 // Sets the properties of the network with id |service_path|. This means the
75 // given properties will be merged with the existing settings, and it won't 74 // given properties will be merged with the existing settings, and it won't
76 // clear any existing properties. See notes on |source| and callbacks in class 75 // clear any existing properties. See notes on |source| and callbacks in class
77 // description above. 76 // description above.
78 void SetProperties(const std::string& service_path, 77 void SetProperties(const std::string& service_path,
79 const base::DictionaryValue& properties, 78 const base::DictionaryValue& properties,
80 NetworkConfigurationObserver::Source source, 79 NetworkConfigurationObserver::Source source,
81 const base::Closure& callback, 80 const base::Closure& callback,
82 const network_handler::ErrorCallback& error_callback); 81 const network_handler::ErrorCallback& error_callback);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 bool PendingProfileEntryDeleterForTest(const std::string& service_path) { 151 bool PendingProfileEntryDeleterForTest(const std::string& service_path) {
153 return profile_entry_deleters_.count(service_path); 152 return profile_entry_deleters_.count(service_path);
154 } 153 }
155 154
156 // Callback after moving a network configuration. 155 // Callback after moving a network configuration.
157 void SetNetworkProfileCompleted(const std::string& service_path, 156 void SetNetworkProfileCompleted(const std::string& service_path,
158 const std::string& profile_path, 157 const std::string& profile_path,
159 NetworkConfigurationObserver::Source source, 158 NetworkConfigurationObserver::Source source,
160 const base::Closure& callback); 159 const base::Closure& callback);
161 160
162 // Invoke the callback and inform NetworkStateHandler to request an update 161 // Set the Name and GUID properties correctly and Invoke |callback|.
162 void GetPropertiesCallback(
163 const network_handler::DictionaryResultCallback& callback,
164 const network_handler::ErrorCallback& error_callback,
165 const std::string& service_path,
166 DBusMethodCallStatus call_status,
167 const base::DictionaryValue& properties);
168
169 // Invoke |callback| and inform NetworkStateHandler to request an update
163 // for the service after setting properties. 170 // for the service after setting properties.
164 void SetPropertiesSuccessCallback( 171 void SetPropertiesSuccessCallback(
165 const std::string& service_path, 172 const std::string& service_path,
166 scoped_ptr<base::DictionaryValue> set_properties, 173 scoped_ptr<base::DictionaryValue> set_properties,
167 NetworkConfigurationObserver::Source source, 174 NetworkConfigurationObserver::Source source,
168 const base::Closure& callback); 175 const base::Closure& callback);
169 void SetPropertiesErrorCallback( 176 void SetPropertiesErrorCallback(
170 const std::string& service_path, 177 const std::string& service_path,
171 const network_handler::ErrorCallback& error_callback, 178 const network_handler::ErrorCallback& error_callback,
172 const std::string& dbus_error_name, 179 const std::string& dbus_error_name,
173 const std::string& dbus_error_message); 180 const std::string& dbus_error_message);
174 181
175 // Invoke the callback and inform NetworkStateHandler to request an update 182 // Invoke |callback| and inform NetworkStateHandler to request an update
176 // for the service after clearing properties. 183 // for the service after clearing properties.
177 void ClearPropertiesSuccessCallback( 184 void ClearPropertiesSuccessCallback(
178 const std::string& service_path, 185 const std::string& service_path,
179 const std::vector<std::string>& names, 186 const std::vector<std::string>& names,
180 const base::Closure& callback, 187 const base::Closure& callback,
181 const base::ListValue& result); 188 const base::ListValue& result);
182 void ClearPropertiesErrorCallback( 189 void ClearPropertiesErrorCallback(
183 const std::string& service_path, 190 const std::string& service_path,
184 const network_handler::ErrorCallback& error_callback, 191 const network_handler::ErrorCallback& error_callback,
185 const std::string& dbus_error_name, 192 const std::string& dbus_error_name,
(...skipping 10 matching lines...) Expand all
196 std::map<std::string, ProfileEntryDeleter*> profile_entry_deleters_; 203 std::map<std::string, ProfileEntryDeleter*> profile_entry_deleters_;
197 204
198 ObserverList<NetworkConfigurationObserver> observers_; 205 ObserverList<NetworkConfigurationObserver> observers_;
199 206
200 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationHandler); 207 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationHandler);
201 }; 208 };
202 209
203 } // namespace chromeos 210 } // namespace chromeos
204 211
205 #endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_ 212 #endif // CHROMEOS_NETWORK_NETWORK_CONFIGURATION_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698