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

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: EnsureInitialized in WiFiService SetEventObservers. Created 6 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 | « chrome/utility/chrome_content_utility_ipc_whitelist.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1280b4944ec666593db09375b87ffb98890820c7 100644
--- a/components/wifi/wifi_service_win.cc
+++ b/components/wifi/wifi_service_win.cc
@@ -703,9 +703,34 @@ void WiFiServiceImpl::SetEventObservers(
scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
const NetworkGuidListCallback& networks_changed_observer,
const NetworkGuidListCallback& network_list_changed_observer) {
+ DWORD error_code = EnsureInitialized();
+ if (error_code != ERROR_SUCCESS)
+ return;
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 +968,6 @@ DWORD WiFiServiceImpl::OpenClientHandle() {
break;
}
}
- WlanRegisterNotification_function_(client_,
- WLAN_NOTIFICATION_SOURCE_ALL,
- FALSE,
- OnWlanNotificationCallback,
- this,
- NULL,
- NULL);
} else {
error = ERROR_NOINTERFACE;
}
« no previous file with comments | « chrome/utility/chrome_content_utility_ipc_whitelist.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698