| 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" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 passphrase_textfield_(NULL), | 370 passphrase_textfield_(NULL), |
| 371 passphrase_visible_button_(NULL), | 371 passphrase_visible_button_(NULL), |
| 372 error_label_(NULL) { | 372 error_label_(NULL) { |
| 373 Init(NULL, show_8021x); | 373 Init(NULL, show_8021x); |
| 374 } | 374 } |
| 375 | 375 |
| 376 WifiConfigView::~WifiConfigView() { | 376 WifiConfigView::~WifiConfigView() { |
| 377 CertLibrary::Get()->RemoveObserver(this); | 377 CertLibrary::Get()->RemoveObserver(this); |
| 378 } | 378 } |
| 379 | 379 |
| 380 string16 WifiConfigView::GetTitle() const { |
| 381 return l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_JOIN_WIFI_NETWORKS); |
| 382 } |
| 383 |
| 380 views::View* WifiConfigView::GetInitiallyFocusedView() { | 384 views::View* WifiConfigView::GetInitiallyFocusedView() { |
| 381 // Return a reasonable widget for initial focus, | 385 // Return a reasonable widget for initial focus, |
| 382 // depending on what we're showing. | 386 // depending on what we're showing. |
| 383 if (ssid_textfield_) | 387 if (ssid_textfield_) |
| 384 return ssid_textfield_; | 388 return ssid_textfield_; |
| 385 else if (eap_method_combobox_) | 389 else if (eap_method_combobox_) |
| 386 return eap_method_combobox_; | 390 return eap_method_combobox_; |
| 387 else if (passphrase_textfield_ && passphrase_textfield_->enabled()) | 391 else if (passphrase_textfield_ && passphrase_textfield_->enabled()) |
| 388 return passphrase_textfield_; | 392 return passphrase_textfield_; |
| 389 else | 393 else |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); | 886 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); |
| 883 // Textfield, combobox. | 887 // Textfield, combobox. |
| 884 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 888 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 885 views::GridLayout::USE_PREF, 0, | 889 views::GridLayout::USE_PREF, 0, |
| 886 ChildNetworkConfigView::kInputFieldMinWidth); | 890 ChildNetworkConfigView::kInputFieldMinWidth); |
| 887 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); | 891 column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing); |
| 888 // Password visible button / policy indicator. | 892 // Password visible button / policy indicator. |
| 889 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, | 893 column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, |
| 890 views::GridLayout::USE_PREF, 0, kPasswordVisibleWidth); | 894 views::GridLayout::USE_PREF, 0, kPasswordVisibleWidth); |
| 891 | 895 |
| 892 // Title | |
| 893 layout->StartRow(0, column_view_set_id); | |
| 894 views::Label* title = new views::Label(l10n_util::GetStringUTF16( | |
| 895 IDS_OPTIONS_SETTINGS_JOIN_WIFI_NETWORKS)); | |
| 896 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | |
| 897 title->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont)); | |
| 898 layout->AddView(title, 5, 1); | |
| 899 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); | |
| 900 | |
| 901 // SSID input | 896 // SSID input |
| 902 layout->StartRow(0, column_view_set_id); | 897 layout->StartRow(0, column_view_set_id); |
| 903 layout->AddView(new views::Label(l10n_util::GetStringUTF16( | 898 layout->AddView(new views::Label(l10n_util::GetStringUTF16( |
| 904 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NETWORK_ID))); | 899 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NETWORK_ID))); |
| 905 if (!wifi) { | 900 if (!wifi) { |
| 906 ssid_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); | 901 ssid_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); |
| 907 ssid_textfield_->SetController(this); | 902 ssid_textfield_->SetController(this); |
| 908 ssid_textfield_->SetAccessibleName(l10n_util::GetStringUTF16( | 903 ssid_textfield_->SetAccessibleName(l10n_util::GetStringUTF16( |
| 909 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NETWORK_ID)); | 904 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_NETWORK_ID)); |
| 910 layout->AddView(ssid_textfield_); | 905 layout->AddView(ssid_textfield_); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 void WifiConfigView::ParseWiFiEAPUIProperty( | 1258 void WifiConfigView::ParseWiFiEAPUIProperty( |
| 1264 NetworkPropertyUIData* property_ui_data, | 1259 NetworkPropertyUIData* property_ui_data, |
| 1265 Network* network, | 1260 Network* network, |
| 1266 const std::string& key) { | 1261 const std::string& key) { |
| 1267 ParseWiFiUIProperty( | 1262 ParseWiFiUIProperty( |
| 1268 property_ui_data, network, | 1263 property_ui_data, network, |
| 1269 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); | 1264 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); |
| 1270 } | 1265 } |
| 1271 | 1266 |
| 1272 } // namespace chromeos | 1267 } // namespace chromeos |
| OLD | NEW |