OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
12 #include "base/string16.h" | 14 #include "base/string16.h" |
13 #include "chrome/browser/chromeos/cros/cert_library.h" | 15 #include "chrome/browser/chromeos/cros/cert_library.h" |
14 #include "chrome/browser/chromeos/options/network_config_view.h" | 16 #include "chrome/browser/chromeos/options/network_config_view.h" |
15 #include "ui/base/models/combobox_model.h" | 17 #include "ui/base/models/combobox_model.h" |
16 #include "views/controls/button/button.h" | 18 #include "views/controls/button/button.h" |
17 #include "views/controls/combobox/combobox.h" | 19 #include "views/controls/combobox/combobox_listener.h" |
18 #include "views/controls/textfield/textfield_controller.h" | 20 #include "views/controls/textfield/textfield_controller.h" |
19 #include "views/view.h" | 21 #include "views/view.h" |
20 | 22 |
21 namespace views { | 23 namespace views { |
22 class Checkbox; | 24 class Checkbox; |
23 class ToggleImageButton; | 25 class ToggleImageButton; |
24 class Label; | 26 class Label; |
25 } | 27 } |
26 | 28 |
27 namespace chromeos { | 29 namespace chromeos { |
28 | 30 |
29 // A dialog box for showing a password textfield. | 31 // A dialog box for showing a password textfield. |
30 class WifiConfigView : public ChildNetworkConfigView, | 32 class WifiConfigView : public ChildNetworkConfigView, |
31 public views::TextfieldController, | 33 public views::TextfieldController, |
32 public views::ButtonListener, | 34 public views::ButtonListener, |
33 public views::Combobox::Listener, | 35 public views::ComboboxListener, |
34 public CertLibrary::Observer { | 36 public CertLibrary::Observer { |
35 public: | 37 public: |
36 // Wifi login dialog for wifi network |wifi|. |wifi| must be a non NULL | 38 // Wifi login dialog for wifi network |wifi|. |wifi| must be a non NULL |
37 // pointer to a WifiNetwork in NetworkLibrary. | 39 // pointer to a WifiNetwork in NetworkLibrary. |
38 WifiConfigView(NetworkConfigView* parent, WifiNetwork* wifi); | 40 WifiConfigView(NetworkConfigView* parent, WifiNetwork* wifi); |
39 // Wifi login dialog for "Joining other network..." | 41 // Wifi login dialog for "Joining other network..." |
40 WifiConfigView(NetworkConfigView* parent, bool show_8021x); | 42 WifiConfigView(NetworkConfigView* parent, bool show_8021x); |
41 virtual ~WifiConfigView(); | 43 virtual ~WifiConfigView(); |
42 | 44 |
43 // views::TextfieldController: | 45 // views::TextfieldController: |
44 virtual void ContentsChanged( | 46 virtual void ContentsChanged(views::Textfield* sender, |
45 views::Textfield* sender, const string16& new_contents) OVERRIDE; | 47 const string16& new_contents) OVERRIDE; |
46 virtual bool HandleKeyEvent( | 48 virtual bool HandleKeyEvent(views::Textfield* sender, |
47 views::Textfield* sender, const views::KeyEvent& key_event) OVERRIDE; | 49 const views::KeyEvent& key_event) OVERRIDE; |
48 | 50 |
49 // views::ButtonListener: | 51 // views::ButtonListener: |
50 virtual void ButtonPressed( | 52 virtual void ButtonPressed(views::Button* sender, |
51 views::Button* sender, const views::Event& event) OVERRIDE; | 53 const views::Event& event) OVERRIDE; |
52 | 54 |
53 // views::Combobox::Listener: | 55 // views::ComboboxListener: |
54 virtual void ItemChanged( | 56 virtual void ItemChanged(views::Combobox* combo_box, |
55 views::Combobox* combo_box, int prev_index, int new_index) OVERRIDE; | 57 int prev_index, |
| 58 int new_index) OVERRIDE; |
56 | 59 |
57 // CertLibrary::Observer: | 60 // CertLibrary::Observer: |
58 virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; | 61 virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; |
59 | 62 |
60 // ChildNetworkConfigView implementation. | 63 // ChildNetworkConfigView: |
61 virtual string16 GetTitle() OVERRIDE; | 64 virtual string16 GetTitle() OVERRIDE; |
62 virtual bool CanLogin() OVERRIDE; | 65 virtual bool CanLogin() OVERRIDE; |
63 virtual bool Login() OVERRIDE; | 66 virtual bool Login() OVERRIDE; |
64 virtual void Cancel() OVERRIDE; | 67 virtual void Cancel() OVERRIDE; |
65 virtual void InitFocus() OVERRIDE; | 68 virtual void InitFocus() OVERRIDE; |
66 | 69 |
67 private: | 70 private: |
68 // Initializes UI. If |show_8021x| includes 802.1x config options. | 71 // Initializes UI. If |show_8021x| includes 802.1x config options. |
69 void Init(WifiNetwork* wifi, bool show_8021x); | 72 void Init(WifiNetwork* wifi, bool show_8021x); |
70 | 73 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 views::Textfield* passphrase_textfield_; | 129 views::Textfield* passphrase_textfield_; |
127 views::ToggleImageButton* passphrase_visible_button_; | 130 views::ToggleImageButton* passphrase_visible_button_; |
128 views::Label* error_label_; | 131 views::Label* error_label_; |
129 | 132 |
130 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); | 133 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); |
131 }; | 134 }; |
132 | 135 |
133 } // namespace chromeos | 136 } // namespace chromeos |
134 | 137 |
135 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ | 138 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ |
OLD | NEW |