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

Side by Side Diff: chrome/browser/chromeos/options/wifi_config_view.cc

Issue 10824131: Password length enforcement (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simpler fix Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/options/wifi_config_view.h" 5 #include "chrome/browser/chromeos/options/wifi_config_view.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 bool WifiConfigView::CanLogin() { 396 bool WifiConfigView::CanLogin() {
397 static const size_t kMinWirelessPasswordLen = 5; 397 static const size_t kMinWirelessPasswordLen = 5;
398 398
399 // We either have an existing wifi network or the user entered an SSID. 399 // We either have an existing wifi network or the user entered an SSID.
400 if (service_path_.empty() && GetSsid().empty()) 400 if (service_path_.empty() && GetSsid().empty())
401 return false; 401 return false;
402 402
403 // If the network requires a passphrase, make sure it is the right length. 403 // If the network requires a passphrase, make sure it is the right length.
404 if (passphrase_textfield_ != NULL 404 if (passphrase_textfield_ != NULL
405 && PassphraseActive() 405 && passphrase_textfield_->enabled()
406 && passphrase_textfield_->text().length() < kMinWirelessPasswordLen) 406 && passphrase_textfield_->text().length() < kMinWirelessPasswordLen)
407 return false; 407 return false;
408 408
409 // If we're using EAP, we must have a method. 409 // If we're using EAP, we must have a method.
410 if (eap_method_combobox_ && 410 if (eap_method_combobox_ &&
411 eap_method_combobox_->selected_index() == EAP_METHOD_INDEX_NONE) 411 eap_method_combobox_->selected_index() == EAP_METHOD_INDEX_NONE)
412 return false; 412 return false;
413 413
414 // Block login if certs are required but user has none. 414 // Block login if certs are required but user has none.
415 if (UserCertRequired() && (!HaveUserCerts() || !IsUserCertValid())) 415 if (UserCertRequired() && (!HaveUserCerts() || !IsUserCertValid()))
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1257 void WifiConfigView::ParseWiFiEAPUIProperty( 1257 void WifiConfigView::ParseWiFiEAPUIProperty(
1258 NetworkPropertyUIData* property_ui_data, 1258 NetworkPropertyUIData* property_ui_data,
1259 Network* network, 1259 Network* network,
1260 const std::string& key) { 1260 const std::string& key) {
1261 ParseWiFiUIProperty( 1261 ParseWiFiUIProperty(
1262 property_ui_data, network, 1262 property_ui_data, network,
1263 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); 1263 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str()));
1264 } 1264 }
1265 1265
1266 } // namespace chromeos 1266 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698