| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/internet_options_handler.h" | 5 #include "chrome/browser/chromeos/dom_ui/internet_options_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_IDENTITY)); | 151 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_IDENTITY)); |
| 152 localized_strings->SetString("inetCert", | 152 localized_strings->SetString("inetCert", |
| 153 l10n_util::GetStringUTF16( | 153 l10n_util::GetStringUTF16( |
| 154 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT)); | 154 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT)); |
| 155 localized_strings->SetString("inetCertPass", | 155 localized_strings->SetString("inetCertPass", |
| 156 l10n_util::GetStringUTF16( | 156 l10n_util::GetStringUTF16( |
| 157 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PRIVATE_KEY_PASSWORD)); | 157 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PRIVATE_KEY_PASSWORD)); |
| 158 localized_strings->SetString("inetPassProtected", | 158 localized_strings->SetString("inetPassProtected", |
| 159 l10n_util::GetStringUTF16( | 159 l10n_util::GetStringUTF16( |
| 160 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NET_PROTECTED)); | 160 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NET_PROTECTED)); |
| 161 localized_strings->SetString("inetRememberNetwork", | 161 localized_strings->SetString("inetAutoConnectNetwork", |
| 162 l10n_util::GetStringUTF16( | 162 l10n_util::GetStringUTF16( |
| 163 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT)); | 163 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT)); |
| 164 localized_strings->SetString("inetCertPkcs", | 164 localized_strings->SetString("inetCertPkcs", |
| 165 l10n_util::GetStringUTF16( | 165 l10n_util::GetStringUTF16( |
| 166 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_INSTALLED)); | 166 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_INSTALLED)); |
| 167 localized_strings->SetString("inetLogin", | 167 localized_strings->SetString("inetLogin", |
| 168 l10n_util::GetStringUTF16( | 168 l10n_util::GetStringUTF16( |
| 169 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_LOGIN)); | 169 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_LOGIN)); |
| 170 localized_strings->SetString("inetShowPass", | 170 localized_strings->SetString("inetShowPass", |
| 171 l10n_util::GetStringUTF16( | 171 l10n_util::GetStringUTF16( |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 plan_dict->SetString("name", plan.plan_name); | 452 plan_dict->SetString("name", plan.plan_name); |
| 453 plan_dict->SetString("planSummary", plan.GetPlanDesciption()); | 453 plan_dict->SetString("planSummary", plan.GetPlanDesciption()); |
| 454 plan_dict->SetString("dataRemaining", plan.GetDataRemainingDesciption()); | 454 plan_dict->SetString("dataRemaining", plan.GetDataRemainingDesciption()); |
| 455 plan_dict->SetString("planExpires", plan.GetPlanExpiration()); | 455 plan_dict->SetString("planExpires", plan.GetPlanExpiration()); |
| 456 plan_dict->SetString("warning", plan.GetRemainingWarning()); | 456 plan_dict->SetString("warning", plan.GetRemainingWarning()); |
| 457 return plan_dict; | 457 return plan_dict; |
| 458 } | 458 } |
| 459 | 459 |
| 460 void InternetOptionsHandler::SetDetailsCallback(const ListValue* args) { | 460 void InternetOptionsHandler::SetDetailsCallback(const ListValue* args) { |
| 461 std::string service_path; | 461 std::string service_path; |
| 462 std::string remember; | 462 std::string auto_connect_str; |
| 463 | 463 |
| 464 if (args->GetSize() < 2 || | 464 if (args->GetSize() < 2 || |
| 465 !args->GetString(0, &service_path) || | 465 !args->GetString(0, &service_path) || |
| 466 !args->GetString(1, &remember)) { | 466 !args->GetString(1, &auto_connect_str)) { |
| 467 NOTREACHED(); | 467 NOTREACHED(); |
| 468 return; | 468 return; |
| 469 } | 469 } |
| 470 | 470 |
| 471 if (!chromeos::OwnershipService::GetSharedInstance()->CurrentUserIsOwner()) { | 471 if (!chromeos::OwnershipService::GetSharedInstance()->CurrentUserIsOwner()) { |
| 472 LOG(WARNING) << "Non-owner tried to change a network."; | 472 LOG(WARNING) << "Non-owner tried to change a network."; |
| 473 return; | 473 return; |
| 474 } | 474 } |
| 475 | 475 |
| 476 chromeos::NetworkLibrary* cros = | 476 chromeos::NetworkLibrary* cros = |
| (...skipping 17 matching lines...) Expand all Loading... |
| 494 network->set_identity(ident); | 494 network->set_identity(ident); |
| 495 changed = true; | 495 changed = true; |
| 496 } | 496 } |
| 497 if (certpath != network->cert_path()) { | 497 if (certpath != network->cert_path()) { |
| 498 network->set_cert_path(certpath); | 498 network->set_cert_path(certpath); |
| 499 changed = true; | 499 changed = true; |
| 500 } | 500 } |
| 501 } | 501 } |
| 502 } | 502 } |
| 503 | 503 |
| 504 bool auto_connect = remember == "true"; | 504 bool auto_connect = auto_connect_str == "true"; |
| 505 if (auto_connect != network->auto_connect()) { | 505 if (auto_connect != network->auto_connect()) { |
| 506 network->set_auto_connect(auto_connect); | 506 network->set_auto_connect(auto_connect); |
| 507 changed = true; | 507 changed = true; |
| 508 } | 508 } |
| 509 | 509 |
| 510 if (changed) | 510 if (changed) |
| 511 cros->SaveWifiNetwork(network); | 511 cros->SaveWifiNetwork(network); |
| 512 } | 512 } |
| 513 | 513 |
| 514 // Parse 'path' to determine if the certificate is stored in a pkcs#11 device. | 514 // Parse 'path' to determine if the certificate is stored in a pkcs#11 device. |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 (*it)->name(), | 967 (*it)->name(), |
| 968 (*it)->connecting(), | 968 (*it)->connecting(), |
| 969 (*it)->connected(), | 969 (*it)->connected(), |
| 970 chromeos::TYPE_WIFI, | 970 chromeos::TYPE_WIFI, |
| 971 true, | 971 true, |
| 972 chromeos::ACTIVATION_STATE_UNKNOWN, | 972 chromeos::ACTIVATION_STATE_UNKNOWN, |
| 973 false)); | 973 false)); |
| 974 } | 974 } |
| 975 return list; | 975 return list; |
| 976 } | 976 } |
| OLD | NEW |