| 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;
|
| }
|
|
|