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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 23684042: Eliminate NetworkManagerChanged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 3b12071fbfbc005c376549476824c13d196a0ab5..ae561919cb1d1ed3aefba0bfd58f79900ce42056 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -162,8 +162,8 @@ void NetworkStateHandler::SetTechnologyEnabled(
base::StringPrintf("%s:%d", technology.c_str(), enabled));
shill_property_handler_->SetTechnologyEnabled(
technology, enabled, error_callback);
- // Signal Technology state changed -> ENABLING
- NotifyManagerPropertyChanged();
+ // Signal Device/Technology state changed.
+ NotifyDeviceListChanged();
}
const DeviceState* NetworkStateHandler::GetDeviceState(
@@ -586,8 +586,7 @@ void NetworkStateHandler::UpdateDeviceProperty(const std::string& device_path,
detail += " = " + network_event_log::ValueAsString(value);
NET_LOG_EVENT("DevicePropertyUpdated", detail);
- FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
- DeviceListChanged());
+ NotifyDeviceListChanged();
if (key == flimflam::kScanningProperty && device->scanning() == false)
ScanCompleted(device->type());
@@ -598,10 +597,10 @@ void NetworkStateHandler::CheckPortalListChanged(
check_portal_list_ = check_portal_list;
}
-void NetworkStateHandler::NotifyManagerPropertyChanged() {
- NET_LOG_DEBUG("NotifyManagerPropertyChanged", "");
- FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
- NetworkManagerChanged());
+void NetworkStateHandler::TechnologyListChanged() {
+ // Eventually we would like to replace Technology state with Device state.
+ // For now, treat technology state changes as device list changes.
+ NotifyDeviceListChanged();
}
void NetworkStateHandler::ManagedStateListChanged(
@@ -638,10 +637,7 @@ void NetworkStateHandler::ManagedStateListChanged(
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedShared", shared);
UMA_HISTOGRAM_COUNTS_100("Networks.RememberedUnshared", unshared);
} else if (type == ManagedState::MANAGED_TYPE_DEVICE) {
- NET_LOG_DEBUG("DeviceListChanged",
- base::StringPrintf("Size:%" PRIuS, device_list_.size()));
- FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
- DeviceListChanged());
+ NotifyDeviceListChanged();
} else {
NOTREACHED();
}
@@ -650,6 +646,13 @@ void NetworkStateHandler::ManagedStateListChanged(
//------------------------------------------------------------------------------
// Private methods
+void NetworkStateHandler::NotifyDeviceListChanged() {
+ NET_LOG_DEBUG("NotifyDeviceListChanged",
pneubeck (no reviews) 2013/09/11 20:13:35 nit: maybe log the current technology state as wel
stevenjb 2013/09/11 21:23:46 Right now we have 4 sets of technology states (ava
+ base::StringPrintf("Size:%" PRIuS, device_list_.size()));
+ FOR_EACH_OBSERVER(NetworkStateHandlerObserver, observers_,
+ DeviceListChanged());
+}
+
DeviceState* NetworkStateHandler::GetModifiableDeviceState(
const std::string& device_path) const {
ManagedState* managed = GetModifiableManagedState(&device_list_, device_path);

Powered by Google App Engine
This is Rietveld 408576698