Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "chromeos/dbus/fake_shill_device_client.h" | 5 #include "chromeos/dbus/fake_shill_device_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/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" |
| 11 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
| 12 #include "chromeos/dbus/shill_manager_client.h" | 12 #include "chromeos/dbus/shill_manager_client.h" |
| 13 #include "chromeos/dbus/shill_property_changed_observer.h" | 13 #include "chromeos/dbus/shill_property_changed_observer.h" |
| 14 #include "chromeos/network/shill_property_util.h" | |
| 15 #include "dbus/bus.h" | 14 #include "dbus/bus.h" |
| 16 #include "dbus/message.h" | 15 #include "dbus/message.h" |
| 17 #include "dbus/object_path.h" | 16 #include "dbus/object_path.h" |
| 18 #include "dbus/object_proxy.h" | 17 #include "dbus/object_proxy.h" |
| 19 #include "dbus/values_util.h" | 18 #include "dbus/values_util.h" |
| 20 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 21 | 20 |
| 22 namespace chromeos { | 21 namespace chromeos { |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 properties->SetWithoutPathExpansion(shill::kTypeProperty, | 245 properties->SetWithoutPathExpansion(shill::kTypeProperty, |
| 247 base::Value::CreateStringValue(type)); | 246 base::Value::CreateStringValue(type)); |
| 248 properties->SetWithoutPathExpansion( | 247 properties->SetWithoutPathExpansion( |
| 249 shill::kNameProperty, | 248 shill::kNameProperty, |
| 250 base::Value::CreateStringValue(object_path)); | 249 base::Value::CreateStringValue(object_path)); |
| 251 properties->SetWithoutPathExpansion( | 250 properties->SetWithoutPathExpansion( |
| 252 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); | 251 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); |
| 253 properties->SetWithoutPathExpansion( | 252 properties->SetWithoutPathExpansion( |
| 254 shill::kDBusServiceProperty, | 253 shill::kDBusServiceProperty, |
| 255 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); | 254 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); |
| 256 if (NetworkTypePattern::Cellular().MatchesType(type)) { | 255 if (type == shill::kTypeCellular) { |
|
stevenjb
2014/05/27 22:37:43
I don't think Shill client code should use Network
| |
| 257 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, | 256 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, |
| 258 new base::FundamentalValue(false)); | 257 new base::FundamentalValue(false)); |
| 259 } | 258 } |
| 260 } | 259 } |
| 261 | 260 |
| 262 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { | 261 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { |
| 263 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 262 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
| 264 RemoveDevice(device_path); | 263 RemoveDevice(device_path); |
| 265 | 264 |
| 266 stub_devices_.RemoveWithoutPathExpansion(device_path, NULL); | 265 stub_devices_.RemoveWithoutPathExpansion(device_path, NULL); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 356 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
| 358 observer_list_.find(device_path); | 357 observer_list_.find(device_path); |
| 359 if (iter != observer_list_.end()) | 358 if (iter != observer_list_.end()) |
| 360 return *(iter->second); | 359 return *(iter->second); |
| 361 PropertyObserverList* observer_list = new PropertyObserverList(); | 360 PropertyObserverList* observer_list = new PropertyObserverList(); |
| 362 observer_list_[device_path] = observer_list; | 361 observer_list_[device_path] = observer_list; |
| 363 return *observer_list; | 362 return *observer_list; |
| 364 } | 363 } |
| 365 | 364 |
| 366 } // namespace chromeos | 365 } // namespace chromeos |
| OLD | NEW |