diff options
author | mef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 21:32:07 +0000 |
---|---|---|
committer | mef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 21:32:07 +0000 |
commit | 00c82c9d4fb0471ec31d9520bd52053c613a8732 (patch) | |
tree | 707c3e771c98aa12eeaedbfec819303b86e81e8a /components/wifi/wifi_service_win.cc | |
parent | 326b03e6ff9e590289049e6b48e974ba1770640a (diff) | |
download | chromium_src-00c82c9d4fb0471ec31d9520bd52053c613a8732.zip chromium_src-00c82c9d4fb0471ec31d9520bd52053c613a8732.tar.gz chromium_src-00c82c9d4fb0471ec31d9520bd52053c613a8732.tar.bz2 |
Implementation of Networking Private API VerifyAndEncryptCredentials method on Windows and Mac OS X.
Adds methods to NetworkingPrivateService to verify device credentials and use NetworkingPrivateCredentialsGetter to get wifi password from system.
On Windows that requires launching utility process with UAC privilege elevation, which is not implemented yet.
BUG=328960
Review URL: https://codereview.chromium.org/102993002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/wifi/wifi_service_win.cc')
-rw-r--r-- | components/wifi/wifi_service_win.cc | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc index cd99a00..1280b49 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; } |