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" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 242 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
243 AddDevice(device_path); | 243 AddDevice(device_path); |
244 | 244 |
245 base::DictionaryValue* properties = GetDeviceProperties(device_path); | 245 base::DictionaryValue* properties = GetDeviceProperties(device_path); |
246 properties->SetWithoutPathExpansion(shill::kTypeProperty, | 246 properties->SetWithoutPathExpansion(shill::kTypeProperty, |
247 base::Value::CreateStringValue(type)); | 247 base::Value::CreateStringValue(type)); |
248 properties->SetWithoutPathExpansion( | 248 properties->SetWithoutPathExpansion( |
249 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); | 249 shill::kDBusObjectProperty, base::Value::CreateStringValue(object_path)); |
250 properties->SetWithoutPathExpansion( | 250 properties->SetWithoutPathExpansion( |
251 shill::kDBusServiceProperty, | 251 shill::kDBusServiceProperty, |
252 base::Value::CreateStringValue(modemmanager::kModemManager1)); | 252 base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName)); |
253 if (NetworkTypePattern::Cellular().MatchesType(type)) { | 253 if (NetworkTypePattern::Cellular().MatchesType(type)) { |
254 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, | 254 properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty, |
255 new base::FundamentalValue(false)); | 255 new base::FundamentalValue(false)); |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { | 259 void FakeShillDeviceClient::RemoveDevice(const std::string& device_path) { |
260 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 260 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
261 RemoveDevice(device_path); | 261 RemoveDevice(device_path); |
262 | 262 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 354 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
355 observer_list_.find(device_path); | 355 observer_list_.find(device_path); |
356 if (iter != observer_list_.end()) | 356 if (iter != observer_list_.end()) |
357 return *(iter->second); | 357 return *(iter->second); |
358 PropertyObserverList* observer_list = new PropertyObserverList(); | 358 PropertyObserverList* observer_list = new PropertyObserverList(); |
359 observer_list_[device_path] = observer_list; | 359 observer_list_[device_path] = observer_list; |
360 return *observer_list; | 360 return *observer_list; |
361 } | 361 } |
362 | 362 |
363 } // namespace chromeos | 363 } // namespace chromeos |
OLD | NEW |