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

Unified Diff: chromeos/network/shill_property_handler.cc

Issue 12634019: NetworkChangeNotifierChromeos: Handle IPConfig property changes on the default network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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
« no previous file with comments | « chromeos/network/shill_property_handler.h ('k') | chromeos/network/shill_property_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/shill_property_handler.cc
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc
index 2041139ea131d04243aaf96d70afa9c7333b11de..6749518b02beac0819026e3e5345521837757035 100644
--- a/chromeos/network/shill_property_handler.cc
+++ b/chromeos/network/shill_property_handler.cc
@@ -16,6 +16,7 @@
#include "chromeos/dbus/shill_manager_client.h"
#include "chromeos/dbus/shill_service_client.h"
#include "chromeos/network/network_event_log.h"
+#include "chromeos/network/network_state.h"
#include "dbus/object_path.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -415,7 +416,7 @@ void ShillPropertyHandler::NetworkServicePropertyChangedCallback(
const std::string& key,
const base::Value& value) {
if (key == shill::kIPConfigProperty) {
- // Handle IPConfig here and call listener_->UpdateNetworkServiceIPAddress
+ // Request the IPConfig for the network and update network properties
// when the request completes.
std::string ip_config_path;
value.GetAsString(&ip_config_path);
@@ -434,16 +435,30 @@ void ShillPropertyHandler::GetIPConfigCallback(
DBusMethodCallStatus call_status,
const base::DictionaryValue& properties) {
if (call_status != DBUS_METHOD_CALL_SUCCESS) {
- LOG(ERROR) << "Failed to get IP properties for: " << service_path;
+ LOG(ERROR) << "Failed to get IP Config properties for: " << service_path;
return;
}
- std::string ip_address;
- if (!properties.GetStringWithoutPathExpansion(flimflam::kAddressProperty,
- &ip_address)) {
+ const base::Value* ip_address;
+ if (!properties.GetWithoutPathExpansion(flimflam::kAddressProperty,
+ &ip_address)) {
LOG(ERROR) << "Failed to get IP Address property for: " << service_path;
return;
}
- listener_->UpdateNetworkServiceIPAddress(service_path, ip_address);
+ listener_->UpdateNetworkServiceProperty(
+ service_path,
+ NetworkState::IPConfigProperty(flimflam::kAddressProperty),
+ *ip_address);
+
+ const base::Value* dns_servers = NULL;
+ if (!properties.GetWithoutPathExpansion(
+ flimflam::kNameServersProperty, &dns_servers)) {
+ LOG(ERROR) << "Failed to get Name servers property for: " << service_path;
+ return;
+ }
+ listener_->UpdateNetworkServiceProperty(
+ service_path,
+ NetworkState::IPConfigProperty(flimflam::kNameServersProperty),
+ *dns_servers);
}
void ShillPropertyHandler::NetworkDevicePropertyChangedCallback(
« no previous file with comments | « chromeos/network/shill_property_handler.h ('k') | chromeos/network/shill_property_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698