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

Unified Diff: components/wifi/wifi_service_win.cc

Issue 102993002: Implement Networking Private API VerifyAndEncryptCredentials method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to r255173 Created 6 years, 10 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: components/wifi/wifi_service_win.cc
diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc
index cd99a0077c4c535d34459160c705e4094f3a3cd2..1278cb28805e8134219ba6ea093cee5d2c0d312f 100644
--- a/components/wifi/wifi_service_win.cc
+++ b/components/wifi/wifi_service_win.cc
@@ -704,8 +704,30 @@ void WiFiServiceImpl::SetEventObservers(
const NetworkGuidListCallback& networks_changed_observer,
const NetworkGuidListCallback& network_list_changed_observer) {
message_loop_proxy_.swap(message_loop_proxy);
+ if (!networks_changed_observer_.is_null() ||
+ !network_list_changed_observer_.is_null()) {
+ // Stop listening to WLAN notifications.
+ WlanRegisterNotification_function_(client_,
+ WLAN_NOTIFICATION_SOURCE_NONE,
+ FALSE,
+ OnWlanNotificationCallback,
+ this,
+ NULL,
+ NULL);
+ }
networks_changed_observer_ = networks_changed_observer;
network_list_changed_observer_ = network_list_changed_observer;
+ if (!networks_changed_observer_.is_null() ||
+ !network_list_changed_observer_.is_null()) {
+ // Start listening to WLAN notifications.
+ WlanRegisterNotification_function_(client_,
+ WLAN_NOTIFICATION_SOURCE_ALL,
+ FALSE,
+ OnWlanNotificationCallback,
+ this,
+ NULL,
+ NULL);
+ }
}
void WiFiServiceImpl::OnWlanNotificationCallback(
@@ -943,13 +965,6 @@ DWORD WiFiServiceImpl::OpenClientHandle() {
break;
}
}
- WlanRegisterNotification_function_(client_,
- WLAN_NOTIFICATION_SOURCE_ALL,
- FALSE,
- OnWlanNotificationCallback,
- this,
- NULL,
- NULL);
} else {
error = ERROR_NOINTERFACE;
}

Powered by Google App Engine
This is Rietveld 408576698