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

Unified Diff: chrome/browser/chromeos/dom_ui/internet_options_handler.cc

Issue 4162004: Prevented access to WEP passphrase from UI. Fixed forget network button in se... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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/app/generated_resources.grd ('k') | chrome/browser/resources/options/chromeos_internet_detail.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/dom_ui/internet_options_handler.cc
===================================================================
--- chrome/browser/chromeos/dom_ui/internet_options_handler.cc (revision 64860)
+++ chrome/browser/chromeos/dom_ui/internet_options_handler.cc (working copy)
@@ -143,9 +143,9 @@
localized_strings->SetString("inetCertPass",
l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PRIVATE_KEY_PASSWORD));
- localized_strings->SetString("inetPass",
+ localized_strings->SetString("inetPassProtected",
l10n_util::GetStringUTF16(
- IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PASSPHRASE));
+ IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NET_PROTECTED));
localized_strings->SetString("inetRememberNetwork",
l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT));
@@ -505,19 +505,8 @@
return;
bool changed = false;
if (network->encrypted()) {
- std::string password;
-
- if (args->GetSize() != 5 ||
- !args->GetString(4, &password)) {
- NOTREACHED();
- return;
- }
- if (password != network->passphrase()) {
- network->set_passphrase(password);
- changed = true;
- }
-
- if (network->encryption() == chromeos::SECURITY_8021X) {
+ if (network->encrypted() &&
+ network->encryption() == chromeos::SECURITY_8021X) {
std::string ident;
std::string certpath;
@@ -613,7 +602,6 @@
dictionary.SetString("certPass",wireless->passphrase());
} else {
dictionary.SetBoolean("certNeeded", false);
- dictionary.SetString("pass", wireless->passphrase());
}
} else {
dictionary.SetBoolean("encrypted", false);
@@ -640,6 +628,8 @@
l10n_util::GetStringUTF8(IDS_CONFIRM_MESSAGEBOX_YES_BUTTON_LABEL) :
l10n_util::GetStringUTF8(IDS_CONFIRM_MESSAGEBOX_NO_BUTTON_LABEL));
dictionary.SetString("errorState", cellular->GetErrorString());
+ dictionary.SetString("supportUrl",
+ cellular->payment_url());
// Device settings.
dictionary.SetString("manufacturer", cellular->manufacturer());
dictionary.SetString("modelId", cellular->model_id());
@@ -677,7 +667,6 @@
dictionary.SetString("cert", network->cert_path());
} else {
dictionary.SetBoolean("certNeeded", false);
- dictionary.SetString("pass", network->passphrase());
}
dom_ui_->CallJavascriptFunction(
L"options.InternetOptions.showPasswordEntry", dictionary);
@@ -713,26 +702,26 @@
std::string service_path;
std::string identity;
std::string certpath;
- std::string password;
-
- if (args->GetSize() != 4 ||
+ if (args->GetSize() < 3 ||
!args->GetString(0, &service_path) ||
!args->GetString(1, &certpath) ||
- !args->GetString(2, &identity) ||
- !args->GetString(3, &password)) {
- NOTREACHED();
+ !args->GetString(2, &identity)) {
return;
}
chromeos::NetworkLibrary* cros =
chromeos::CrosLibrary::Get()->GetNetworkLibrary();
chromeos::WifiNetwork* network =
cros->FindWifiNetworkByPath(service_path);
- if (network) {
- cros->ConnectToWifiNetwork(
- network, password, identity, certpath);
- } else {
- // TODO(dhg): Send error back to UI
+ if (!network)
+ return;
+ // If password does not come from the input, use one saved with the
+ // network details.
+ std::string password;
+ if (args->GetSize() != 4 || !args->GetString(3, &password)) {
+ password = network->passphrase();
}
+ cros->ConnectToWifiNetwork(
+ network, password, identity, certpath);
}
void InternetOptionsHandler::LoginToOtherCallback(const ListValue* args) {
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/options/chromeos_internet_detail.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698