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/flimflam_device_client.h" | 5 #include "chromeos/dbus/flimflam_device_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 cellular_properties->SetWithoutPathExpansion( | 218 cellular_properties->SetWithoutPathExpansion( |
219 flimflam::kTypeProperty, | 219 flimflam::kTypeProperty, |
220 base::Value::CreateStringValue(flimflam::kTypeCellular)); | 220 base::Value::CreateStringValue(flimflam::kTypeCellular)); |
221 cellular_properties->SetWithoutPathExpansion( | 221 cellular_properties->SetWithoutPathExpansion( |
222 flimflam::kDBusConnectionProperty, | 222 flimflam::kDBusConnectionProperty, |
223 base::Value::CreateStringValue("/stub")); | 223 base::Value::CreateStringValue("/stub")); |
224 cellular_properties->SetWithoutPathExpansion( | 224 cellular_properties->SetWithoutPathExpansion( |
225 flimflam::kDBusObjectProperty, | 225 flimflam::kDBusObjectProperty, |
226 base::Value::CreateStringValue("/device/cellular1")); | 226 base::Value::CreateStringValue("/device/cellular1")); |
227 stub_devices_.Set(kStubCellular1, cellular_properties); | 227 stub_devices_.Set(kStubCellular1, cellular_properties); |
| 228 |
| 229 // Create a second device stubbing a modem managed by |
| 230 // ModemManager1 interfaces. |
| 231 // Note: name matches Manager entry. |
| 232 const char kStubCellular2[] = "stub_cellular2"; |
| 233 cellular_properties = new base::DictionaryValue; |
| 234 cellular_properties->SetWithoutPathExpansion( |
| 235 flimflam::kTypeProperty, |
| 236 base::Value::CreateStringValue(flimflam::kTypeCellular)); |
| 237 cellular_properties->SetWithoutPathExpansion( |
| 238 flimflam::kDBusConnectionProperty, |
| 239 base::Value::CreateStringValue(":stub.0")); |
| 240 cellular_properties->SetWithoutPathExpansion( |
| 241 flimflam::kDBusObjectProperty, |
| 242 base::Value::CreateStringValue( |
| 243 "/org/freedesktop/ModemManager1/stub/0")); |
| 244 stub_devices_.Set(kStubCellular2, cellular_properties); |
228 } | 245 } |
229 | 246 |
230 virtual ~FlimflamDeviceClientStubImpl() {} | 247 virtual ~FlimflamDeviceClientStubImpl() {} |
231 | 248 |
232 // FlimflamDeviceClient override. | 249 // FlimflamDeviceClient override. |
233 virtual void SetPropertyChangedHandler( | 250 virtual void SetPropertyChangedHandler( |
234 const dbus::ObjectPath& device_path, | 251 const dbus::ObjectPath& device_path, |
235 const PropertyChangedHandler& handler) OVERRIDE {} | 252 const PropertyChangedHandler& handler) OVERRIDE {} |
236 | 253 |
237 // FlimflamDeviceClient override. | 254 // FlimflamDeviceClient override. |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 FlimflamDeviceClient* FlimflamDeviceClient::Create( | 400 FlimflamDeviceClient* FlimflamDeviceClient::Create( |
384 DBusClientImplementationType type, | 401 DBusClientImplementationType type, |
385 dbus::Bus* bus) { | 402 dbus::Bus* bus) { |
386 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 403 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
387 return new FlimflamDeviceClientImpl(bus); | 404 return new FlimflamDeviceClientImpl(bus); |
388 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 405 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
389 return new FlimflamDeviceClientStubImpl(); | 406 return new FlimflamDeviceClientStubImpl(); |
390 } | 407 } |
391 | 408 |
392 } // namespace chromeos | 409 } // namespace chromeos |
OLD | NEW |