OLD | NEW |
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 #include "chromeos/dbus/shill_manager_client.h" | 5 #include "chromeos/dbus/shill_manager_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 virtual void ConnectToBestServices( | 204 virtual void ConnectToBestServices( |
205 const base::Closure& callback, | 205 const base::Closure& callback, |
206 const ErrorCallback& error_callback) override { | 206 const ErrorCallback& error_callback) override { |
207 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, | 207 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, |
208 shill::kConnectToBestServicesFunction); | 208 shill::kConnectToBestServicesFunction); |
209 helper_->CallVoidMethodWithErrorCallback(&method_call, | 209 helper_->CallVoidMethodWithErrorCallback(&method_call, |
210 callback, | 210 callback, |
211 error_callback); | 211 error_callback); |
212 } | 212 } |
213 | 213 |
214 virtual void AddWakeOnPacketConnection( | |
215 const net::IPEndPoint& ip_endpoint, | |
216 const base::Closure& callback, | |
217 const ErrorCallback& error_callback) override { | |
218 if (ip_endpoint.address().empty()) { | |
219 LOG(ERROR) << "AddWakeOnPacketConnection: null address"; | |
220 return; | |
221 } | |
222 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, | |
223 shill::kAddWakeOnPacketConnectionFunction); | |
224 dbus::MessageWriter writer(&method_call); | |
225 writer.AppendString(net::IPAddressToString(ip_endpoint.address())); | |
226 helper_->CallVoidMethodWithErrorCallback(&method_call, | |
227 callback, | |
228 error_callback); | |
229 } | |
230 | |
231 virtual void RemoveWakeOnPacketConnection( | |
232 const net::IPEndPoint& ip_endpoint, | |
233 const base::Closure& callback, | |
234 const ErrorCallback& error_callback) override { | |
235 if (ip_endpoint.address().empty()) { | |
236 LOG(ERROR) << "RemoveWakeOnPacketConnection: null address"; | |
237 return; | |
238 } | |
239 dbus::MethodCall method_call(shill::kFlimflamManagerInterface, | |
240 shill::kRemoveWakeOnPacketConnectionFunction); | |
241 dbus::MessageWriter writer(&method_call); | |
242 writer.AppendString(net::IPAddressToString(ip_endpoint.address())); | |
243 helper_->CallVoidMethodWithErrorCallback(&method_call, | |
244 callback, | |
245 error_callback); | |
246 } | |
247 | |
248 virtual void RemoveAllWakeOnPacketConnections( | |
249 const base::Closure& callback, | |
250 const ErrorCallback& error_callback) override { | |
251 dbus::MethodCall method_call( | |
252 shill::kFlimflamManagerInterface, | |
253 shill::kRemoveAllWakeOnPacketConnectionsFunction); | |
254 helper_->CallVoidMethodWithErrorCallback(&method_call, | |
255 callback, | |
256 error_callback); | |
257 } | |
258 | |
259 virtual TestInterface* GetTestInterface() override { | 214 virtual TestInterface* GetTestInterface() override { |
260 return NULL; | 215 return NULL; |
261 } | 216 } |
262 | 217 |
263 protected: | 218 protected: |
264 virtual void Init(dbus::Bus* bus) override { | 219 virtual void Init(dbus::Bus* bus) override { |
265 proxy_ = bus->GetObjectProxy(shill::kFlimflamServiceName, | 220 proxy_ = bus->GetObjectProxy(shill::kFlimflamServiceName, |
266 dbus::ObjectPath(shill::kFlimflamServicePath)); | 221 dbus::ObjectPath(shill::kFlimflamServicePath)); |
267 helper_.reset(new ShillClientHelper(proxy_)); | 222 helper_.reset(new ShillClientHelper(proxy_)); |
268 helper_->MonitorPropertyChanged(shill::kFlimflamManagerInterface); | 223 helper_->MonitorPropertyChanged(shill::kFlimflamManagerInterface); |
(...skipping 18 matching lines...) Expand all Loading... |
287 } | 242 } |
288 | 243 |
289 // ShillManagerClient::VerificationProperties implementation. | 244 // ShillManagerClient::VerificationProperties implementation. |
290 ShillManagerClient::VerificationProperties::VerificationProperties() { | 245 ShillManagerClient::VerificationProperties::VerificationProperties() { |
291 } | 246 } |
292 | 247 |
293 ShillManagerClient::VerificationProperties::~VerificationProperties() { | 248 ShillManagerClient::VerificationProperties::~VerificationProperties() { |
294 } | 249 } |
295 | 250 |
296 } // namespace chromeos | 251 } // namespace chromeos |
OLD | NEW |