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 "chrome/browser/profiles/profile_manager.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/event.h" |
20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
22 #include "ui/views/controls/button/checkbox.h" | 23 #include "ui/views/controls/button/checkbox.h" |
23 #include "ui/views/controls/button/image_button.h" | 24 #include "ui/views/controls/button/image_button.h" |
24 #include "ui/views/controls/combobox/combobox.h" | 25 #include "ui/views/controls/combobox/combobox.h" |
25 #include "ui/views/controls/label.h" | 26 #include "ui/views/controls/label.h" |
26 #include "ui/views/controls/textfield/textfield.h" | 27 #include "ui/views/controls/textfield/textfield.h" |
27 #include "ui/views/layout/grid_layout.h" | 28 #include "ui/views/layout/grid_layout.h" |
28 #include "ui/views/layout/layout_constants.h" | 29 #include "ui/views/layout/layout_constants.h" |
29 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 error_label_->SetVisible(false); | 602 error_label_->SetVisible(false); |
602 } | 603 } |
603 } | 604 } |
604 | 605 |
605 void WifiConfigView::ContentsChanged(views::Textfield* sender, | 606 void WifiConfigView::ContentsChanged(views::Textfield* sender, |
606 const string16& new_contents) { | 607 const string16& new_contents) { |
607 UpdateDialogButtons(); | 608 UpdateDialogButtons(); |
608 } | 609 } |
609 | 610 |
610 bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, | 611 bool WifiConfigView::HandleKeyEvent(views::Textfield* sender, |
611 const views::KeyEvent& key_event) { | 612 const ui::KeyEvent& key_event) { |
612 if (sender == passphrase_textfield_ && | 613 if (sender == passphrase_textfield_ && |
613 key_event.key_code() == ui::VKEY_RETURN) { | 614 key_event.key_code() == ui::VKEY_RETURN) { |
614 parent_->GetDialogClientView()->AcceptWindow(); | 615 parent_->GetDialogClientView()->AcceptWindow(); |
615 } | 616 } |
616 return false; | 617 return false; |
617 } | 618 } |
618 | 619 |
619 void WifiConfigView::ButtonPressed(views::Button* sender, | 620 void WifiConfigView::ButtonPressed(views::Button* sender, |
620 const views::Event& event) { | 621 const views::Event& event) { |
621 if (sender == passphrase_visible_button_) { | 622 if (sender == passphrase_visible_button_) { |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 void WifiConfigView::ParseWiFiEAPUIProperty( | 1262 void WifiConfigView::ParseWiFiEAPUIProperty( |
1262 NetworkPropertyUIData* property_ui_data, | 1263 NetworkPropertyUIData* property_ui_data, |
1263 Network* network, | 1264 Network* network, |
1264 const std::string& key) { | 1265 const std::string& key) { |
1265 ParseWiFiUIProperty( | 1266 ParseWiFiUIProperty( |
1266 property_ui_data, network, | 1267 property_ui_data, network, |
1267 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); | 1268 base::StringPrintf("%s.%s", onc::wifi::kEAP, key.c_str())); |
1268 } | 1269 } |
1269 | 1270 |
1270 } // namespace chromeos | 1271 } // namespace chromeos |
OLD | NEW |