Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 | 27 |
| 28 class NetworkConfigView; | 28 class NetworkConfigView; |
| 29 | 29 |
| 30 // A dialog box for showing a password textfield. | 30 // A dialog box for showing a password textfield. |
| 31 class WifiConfigView : public views::View, | 31 class WifiConfigView : public views::View, |
| 32 public views::Textfield::Controller, | 32 public views::Textfield::Controller, |
| 33 public views::ButtonListener, | 33 public views::ButtonListener, |
| 34 public views::Combobox::Listener, | 34 public views::Combobox::Listener, |
| 35 public SelectFileDialog::Listener { | 35 public SelectFileDialog::Listener { |
| 36 public: | 36 public: |
| 37 // Wifi login dialog for wifi network |wifi| | |
| 37 WifiConfigView(NetworkConfigView* parent, const WifiNetwork* wifi); | 38 WifiConfigView(NetworkConfigView* parent, const WifiNetwork* wifi); |
| 39 // Wifi login dialog for "Joining other network..." | |
| 38 explicit WifiConfigView(NetworkConfigView* parent); | 40 explicit WifiConfigView(NetworkConfigView* parent); |
| 39 virtual ~WifiConfigView(); | 41 virtual ~WifiConfigView(); |
| 40 | 42 |
| 41 // views::Textfield::Controller methods. | 43 // views::Textfield::Controller methods. |
| 42 virtual void ContentsChanged(views::Textfield* sender, | 44 virtual void ContentsChanged(views::Textfield* sender, |
| 43 const string16& new_contents); | 45 const string16& new_contents); |
| 44 virtual bool HandleKeyEvent(views::Textfield* sender, | 46 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 45 const views::KeyEvent& key_event); | 47 const views::KeyEvent& key_event); |
| 46 | 48 |
| 47 // views::ButtonListener | 49 // views::ButtonListener |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 61 virtual bool Save(); | 63 virtual bool Save(); |
| 62 | 64 |
| 63 // Cancel the dialog. | 65 // Cancel the dialog. |
| 64 virtual void Cancel(); | 66 virtual void Cancel(); |
| 65 | 67 |
| 66 // Get the typed in ssid. | 68 // Get the typed in ssid. |
| 67 const std::string GetSSID() const; | 69 const std::string GetSSID() const; |
| 68 // Get the typed in passphrase. | 70 // Get the typed in passphrase. |
| 69 const std::string GetPassphrase() const; | 71 const std::string GetPassphrase() const; |
| 70 | 72 |
| 71 // Returns true if the textfields are non-empty and we can login. | 73 // Returns whether or not we can login. |
| 72 bool can_login() const { return can_login_; } | 74 bool CanLogin(); |
| 73 | 75 |
| 74 private: | 76 private: |
| 75 class SecurityComboboxModel : public ui::ComboboxModel { | 77 class SecurityComboboxModel : public ui::ComboboxModel { |
| 76 public: | 78 public: |
| 77 SecurityComboboxModel() {} | 79 SecurityComboboxModel() {} |
| 78 virtual ~SecurityComboboxModel() {} | 80 virtual ~SecurityComboboxModel() {} |
| 79 virtual int GetItemCount(); | 81 virtual int GetItemCount(); |
| 80 virtual string16 GetItemAt(int index); | 82 virtual string16 GetItemAt(int index); |
| 81 private: | 83 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(SecurityComboboxModel); | 84 DISALLOW_COPY_AND_ASSIGN(SecurityComboboxModel); |
| 83 }; | 85 }; |
| 84 | 86 |
| 87 class EAPMethodComboboxModel : public ui::ComboboxModel { | |
| 88 public: | |
| 89 EAPMethodComboboxModel() {} | |
| 90 virtual ~EAPMethodComboboxModel() {} | |
| 91 virtual int GetItemCount(); | |
| 92 virtual string16 GetItemAt(int index); | |
| 93 private: | |
| 94 DISALLOW_COPY_AND_ASSIGN(EAPMethodComboboxModel); | |
| 95 }; | |
| 96 | |
| 97 class Phase2AuthComboboxModel : public ui::ComboboxModel { | |
| 98 public: | |
| 99 explicit Phase2AuthComboboxModel(views::Combobox* eap_method_combobox) | |
| 100 : eap_method_combobox_(eap_method_combobox) {} | |
| 101 virtual ~Phase2AuthComboboxModel() {} | |
| 102 virtual int GetItemCount(); | |
| 103 virtual string16 GetItemAt(int index); | |
| 104 private: | |
| 105 views::Combobox* eap_method_combobox_; | |
| 106 DISALLOW_COPY_AND_ASSIGN(Phase2AuthComboboxModel); | |
| 107 }; | |
|
stevenjb
2011/03/04 01:45:53
Do these need to be in the header, or can we put t
Charlie Lee
2011/03/04 01:54:14
You are right. I put them in the .cc file.
On 201
| |
| 108 | |
| 85 // Initializes UI. | 109 // Initializes UI. |
| 86 void Init(); | 110 void Init(); |
| 87 | 111 |
| 88 // Updates state of the Login button. | 112 // Updates state of the Login button. |
| 89 void UpdateCanLogin(); | 113 void UpdateCanLogin(); |
| 90 | 114 |
| 91 // Updates the error text label. | 115 // Updates the error text label. |
| 92 void UpdateErrorLabel(bool failed); | 116 void UpdateErrorLabel(bool failed); |
| 93 | 117 |
| 94 NetworkConfigView* parent_; | 118 NetworkConfigView* parent_; |
| 95 | 119 |
| 96 // Whether or not we can log in. This gets recalculated when textfield | 120 // Whether or not it is an 802.1x network. |
| 97 // contents change. | 121 bool is_8021x_; |
| 98 bool can_login_; | |
| 99 | 122 |
| 100 scoped_ptr<WifiNetwork> wifi_; | 123 scoped_ptr<WifiNetwork> wifi_; |
| 101 | 124 |
| 102 views::Textfield* ssid_textfield_; | 125 views::Textfield* ssid_textfield_; |
| 126 views::Combobox* eap_method_combobox_; | |
| 127 views::Combobox* phase_2_auth_combobox_; | |
| 103 views::Textfield* identity_textfield_; | 128 views::Textfield* identity_textfield_; |
| 129 views::Textfield* identity_anonymous_textfield_; | |
| 104 views::NativeButton* certificate_browse_button_; | 130 views::NativeButton* certificate_browse_button_; |
| 105 scoped_refptr<SelectFileDialog> select_file_dialog_; | 131 scoped_refptr<SelectFileDialog> select_file_dialog_; |
| 106 std::string certificate_path_; | 132 std::string certificate_path_; |
| 107 views::Combobox* security_combobox_; | 133 views::Combobox* security_combobox_; |
| 108 views::Textfield* passphrase_textfield_; | 134 views::Textfield* passphrase_textfield_; |
| 109 views::ImageButton* passphrase_visible_button_; | 135 views::ImageButton* passphrase_visible_button_; |
| 110 views::Label* error_label_; | 136 views::Label* error_label_; |
| 111 | 137 |
| 112 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); | 138 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); |
| 113 }; | 139 }; |
| 114 | 140 |
| 115 } // namespace chromeos | 141 } // namespace chromeos |
| 116 | 142 |
| 117 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ | 143 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ |
| OLD | NEW |