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

Unified Diff: chromeos/dbus/shill_device_client.cc

Issue 11887008: Deprecate ShillNetworkClient and add GeolocationHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/shill_device_client.cc
diff --git a/chromeos/dbus/shill_device_client.cc b/chromeos/dbus/shill_device_client.cc
index efde0100899faa6c6ba90ce573c494c340deeb7d..e44eca10904b4115fcb8bb42e29fe4cdb3011ef3 100644
--- a/chromeos/dbus/shill_device_client.cc
+++ b/chromeos/dbus/shill_device_client.cc
@@ -375,8 +375,7 @@ class ShillDeviceClientStubImpl : public ShillDeviceClient,
virtual void AddDevice(const std::string& device_path,
const std::string& type,
- const std::string& object_path,
- const std::string& connection_path) OVERRIDE {
+ const std::string& object_path) OVERRIDE {
base::DictionaryValue* properties = GetDeviceProperties(device_path);
properties->SetWithoutPathExpansion(
flimflam::kTypeProperty,
@@ -386,7 +385,7 @@ class ShillDeviceClientStubImpl : public ShillDeviceClient,
base::Value::CreateStringValue(object_path));
properties->SetWithoutPathExpansion(
flimflam::kDBusConnectionProperty,
- base::Value::CreateStringValue(connection_path));
+ base::Value::CreateStringValue("/stub"));
}
virtual void RemoveDevice(const std::string& device_path) OVERRIDE {
@@ -397,18 +396,25 @@ class ShillDeviceClientStubImpl : public ShillDeviceClient,
stub_devices_.Clear();
}
+ virtual void SetDeviceProperty(const std::string& device_path,
+ const std::string& name,
+ const base::Value& value) {
+ SetProperty(dbus::ObjectPath(device_path), name, value,
+ base::Bind(&base::DoNothing),
+ base::Bind(&ShillDeviceClientStubImpl::ErrorFunction));
+ }
+
private:
typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList;
void SetDefaultProperties() {
// Add a wifi device. Note: path matches Manager entry.
- AddDevice("stub_wifi_device1", flimflam::kTypeWifi,
- "/device/wifi1", "/stub");
+ AddDevice("stub_wifi_device1", flimflam::kTypeWifi, "/device/wifi1");
// Add a cellular device. Used in SMS stub. Note: path matches
// Manager entry.
AddDevice("stub_cellular_device1", flimflam::kTypeCellular,
- "/device/cellular1", "/stub");
+ "/device/cellular1");
}
void PassStubDeviceProperties(const dbus::ObjectPath& device_path,
@@ -471,6 +477,11 @@ class ShillDeviceClientStubImpl : public ShillDeviceClient,
return *observer_list;
}
+ static void ErrorFunction(const std::string& error_name,
+ const std::string& error_message) {
+ LOG(ERROR) << "Shill Error: " << error_name << " : " << error_message;
+ }
+
// Dictionary of <device_name, Dictionary>.
base::DictionaryValue stub_devices_;
// Observer list for each device.

Powered by Google App Engine
This is Rietveld 408576698