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/cros/onc_constants.h" | 12 #include "chrome/browser/chromeos/cros/onc_constants.h" |
13 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 13 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
14 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
17 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/views/controls/button/checkbox.h" | 22 #include "ui/views/controls/button/checkbox.h" |
22 #include "ui/views/controls/button/image_button.h" | 23 #include "ui/views/controls/button/image_button.h" |
23 #include "ui/views/controls/combobox/combobox.h" | 24 #include "ui/views/controls/combobox/combobox.h" |
24 #include "ui/views/controls/label.h" | 25 #include "ui/views/controls/label.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 wifi->SetEAPPassphrase(GetPassphrase()); | 722 wifi->SetEAPPassphrase(GetPassphrase()); |
722 wifi->SetSaveCredentials(GetSaveCredentials()); | 723 wifi->SetSaveCredentials(GetSaveCredentials()); |
723 } else { | 724 } else { |
724 // Visible ordinary Wi-Fi connection. | 725 // Visible ordinary Wi-Fi connection. |
725 const std::string passphrase = GetPassphrase(); | 726 const std::string passphrase = GetPassphrase(); |
726 if (passphrase != wifi->passphrase()) | 727 if (passphrase != wifi->passphrase()) |
727 wifi->SetPassphrase(passphrase); | 728 wifi->SetPassphrase(passphrase); |
728 } | 729 } |
729 bool share_default = (wifi->profile_type() != PROFILE_USER); | 730 bool share_default = (wifi->profile_type() != PROFILE_USER); |
730 wifi->SetEnrollmentDelegate( | 731 wifi->SetEnrollmentDelegate( |
731 EnrollmentDialogView::CreateEnrollmentDelegate( | 732 CreateEnrollmentDelegate(GetWidget()->GetNativeWindow(), |
732 GetWidget()->GetNativeWindow())); | 733 ProfileManager::GetLastUsedProfile())); |
733 cros->ConnectToWifiNetwork(wifi, GetShareNetwork(share_default)); | 734 cros->ConnectToWifiNetwork(wifi, GetShareNetwork(share_default)); |
734 // Connection failures are responsible for updating the UI, including | 735 // Connection failures are responsible for updating the UI, including |
735 // reopening dialogs. | 736 // reopening dialogs. |
736 } | 737 } |
737 return true; // dialog will be closed | 738 return true; // dialog will be closed |
738 } | 739 } |
739 | 740 |
740 std::string WifiConfigView::GetSsid() const { | 741 std::string WifiConfigView::GetSsid() const { |
741 std::string result; | 742 std::string result; |
742 if (ssid_textfield_ != NULL) { | 743 if (ssid_textfield_ != NULL) { |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 void WifiConfigView::ParseWiFiEAPUIProperty( | 1250 void WifiConfigView::ParseWiFiEAPUIProperty( |
1250 NetworkPropertyUIData* property_ui_data, | 1251 NetworkPropertyUIData* property_ui_data, |
1251 Network* network, | 1252 Network* network, |
1252 const std::string& key) { | 1253 const std::string& key) { |
1253 ParseWiFiUIProperty( | 1254 ParseWiFiUIProperty( |
1254 property_ui_data, network, | 1255 property_ui_data, network, |
1255 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); | 1256 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); |
1256 } | 1257 } |
1257 | 1258 |
1258 } // namespace chromeos | 1259 } // namespace chromeos |
OLD | NEW |