OLD | NEW |
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" |
11 #include "chrome/browser/chromeos/cros/network_library.h" | 11 #include "chrome/browser/chromeos/cros/network_library.h" |
12 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 12 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
13 #include "chrome/browser/chromeos/login/user_manager.h" | |
14 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chromeos/login/login_state.h" |
15 #include "chromeos/network/onc/onc_constants.h" | 15 #include "chromeos/network/onc/onc_constants.h" |
16 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
19 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
20 #include "ui/base/events/event.h" | 20 #include "ui/base/events/event.h" |
21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
22 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
23 #include "ui/views/controls/button/checkbox.h" | 23 #include "ui/views/controls/button/checkbox.h" |
24 #include "ui/views/controls/button/image_button.h" | 24 #include "ui/views/controls/button/image_button.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 security_combobox_->selected_index() == SECURITY_INDEX_NONE) { | 539 security_combobox_->selected_index() == SECURITY_INDEX_NONE) { |
540 share_network_checkbox_->SetEnabled(false); | 540 share_network_checkbox_->SetEnabled(false); |
541 share_network_checkbox_->SetChecked(true); | 541 share_network_checkbox_->SetChecked(true); |
542 } else if (eap_method_combobox_ && | 542 } else if (eap_method_combobox_ && |
543 (eap_method_combobox_->selected_index() == EAP_METHOD_INDEX_TLS || | 543 (eap_method_combobox_->selected_index() == EAP_METHOD_INDEX_TLS || |
544 user_cert_combobox_->selected_index() != 0)) { | 544 user_cert_combobox_->selected_index() != 0)) { |
545 // Can not share TLS network (requires certificate), or any network where | 545 // Can not share TLS network (requires certificate), or any network where |
546 // user certificates are enabled. | 546 // user certificates are enabled. |
547 share_network_checkbox_->SetEnabled(false); | 547 share_network_checkbox_->SetEnabled(false); |
548 share_network_checkbox_->SetChecked(false); | 548 share_network_checkbox_->SetChecked(false); |
549 } else if (!UserManager::Get()->IsUserLoggedIn()) { | 549 } else if (!LoginState::Get()->IsUserLoggedIn()) { |
550 // If not logged in, networks must be shared. | 550 // If not logged in, networks must be shared. |
551 share_network_checkbox_->SetEnabled(false); | 551 share_network_checkbox_->SetEnabled(false); |
552 share_network_checkbox_->SetChecked(true); | 552 share_network_checkbox_->SetChecked(true); |
553 } else { | 553 } else { |
554 share_network_checkbox_->SetEnabled(true); | 554 share_network_checkbox_->SetEnabled(true); |
555 share_network_checkbox_->SetChecked(false); // Default to unshared. | 555 share_network_checkbox_->SetChecked(false); // Default to unshared. |
556 } | 556 } |
557 } | 557 } |
558 | 558 |
559 void WifiConfigView::UpdateErrorLabel() { | 559 void WifiConfigView::UpdateErrorLabel() { |
560 std::string error_msg; | 560 std::string error_msg; |
561 if (UserCertRequired() && cert_library_->CertificatesLoaded()) { | 561 if (UserCertRequired() && cert_library_->CertificatesLoaded()) { |
562 if (!HaveUserCerts()) { | 562 if (!HaveUserCerts()) { |
563 if (!UserManager::Get()->IsUserLoggedIn()) { | 563 if (!LoginState::Get()->IsUserLoggedIn()) { |
564 error_msg = l10n_util::GetStringUTF8( | 564 error_msg = l10n_util::GetStringUTF8( |
565 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_LOGIN_FOR_USER_CERT); | 565 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_LOGIN_FOR_USER_CERT); |
566 } else { | 566 } else { |
567 error_msg = l10n_util::GetStringUTF8( | 567 error_msg = l10n_util::GetStringUTF8( |
568 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PLEASE_INSTALL_USER_CERT); | 568 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PLEASE_INSTALL_USER_CERT); |
569 } | 569 } |
570 } else if (!IsUserCertValid()) { | 570 } else if (!IsUserCertValid()) { |
571 error_msg = l10n_util::GetStringUTF8( | 571 error_msg = l10n_util::GetStringUTF8( |
572 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_REQUIRE_HARDWARE_BACKED); | 572 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_REQUIRE_HARDWARE_BACKED); |
573 } | 573 } |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 void WifiConfigView::ParseWiFiEAPUIProperty( | 1276 void WifiConfigView::ParseWiFiEAPUIProperty( |
1277 NetworkPropertyUIData* property_ui_data, | 1277 NetworkPropertyUIData* property_ui_data, |
1278 Network* network, | 1278 Network* network, |
1279 const std::string& key) { | 1279 const std::string& key) { |
1280 ParseWiFiUIProperty( | 1280 ParseWiFiUIProperty( |
1281 property_ui_data, network, | 1281 property_ui_data, network, |
1282 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); | 1282 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); |
1283 } | 1283 } |
1284 | 1284 |
1285 } // namespace chromeos | 1285 } // namespace chromeos |
OLD | NEW |