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

Unified Diff: chrome/browser/chromeos/options/wifi_config_view.cc

Issue 7628009: chromium-os:18602 - do not override shared setting on bad password (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/browser/chromeos/options/wifi_config_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/wifi_config_view.cc
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index 453e362be13691c3efab270d9db2704b99844e87..4d40cdf671c681f41c44c16be9b7a9c8f1cbd9b2 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -535,6 +535,7 @@ void WifiConfigView::OnCertificatesLoaded(bool initial_load) {
bool WifiConfigView::Login() {
NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary();
if (service_path_.empty()) {
+ const bool share_default = true; // share networks by default
if (!eap_method_combobox_) {
// Hidden ordinary Wi-Fi connection.
ConnectionSecurity security = SECURITY_UNKNOWN;
@@ -555,7 +556,7 @@ bool WifiConfigView::Login() {
GetPassphrase(),
NULL,
GetSaveCredentials(),
- GetShareNetwork());
+ GetShareNetwork(share_default));
} else {
// Hidden 802.1X EAP Wi-Fi connection.
chromeos::NetworkLibrary::EAPConfigData config_data;
@@ -572,7 +573,7 @@ bool WifiConfigView::Login() {
GetPassphrase(),
&config_data,
GetSaveCredentials(),
- GetShareNetwork());
+ GetShareNetwork(share_default));
}
} else {
WifiNetwork* wifi = cros->FindWifiNetworkByPath(service_path_);
@@ -601,8 +602,8 @@ bool WifiConfigView::Login() {
if (passphrase != wifi->passphrase())
wifi->SetPassphrase(passphrase);
}
-
- cros->ConnectToWifiNetwork(wifi, GetShareNetwork());
+ bool share_default = (wifi->profile_type() == PROFILE_SHARED);
+ cros->ConnectToWifiNetwork(wifi, GetShareNetwork(share_default));
// Connection failures are responsible for updating the UI, including
// reopening dialogs.
}
@@ -631,9 +632,9 @@ bool WifiConfigView::GetSaveCredentials() const {
return save_credentials_checkbox_->checked();
}
-bool WifiConfigView::GetShareNetwork() const {
- if (!share_network_checkbox_)
- return true; // share networks by default (e.g. non secure network).
+bool WifiConfigView::GetShareNetwork(bool share_default) const {
+ if (!share_network_checkbox_ || !share_network_checkbox_->IsEnabled())
+ return share_default;
return share_network_checkbox_->checked();
}
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698