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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/string16.h"
13 #include "chrome/browser/chromeos/options/network_config_view.h"
14 #include "chrome/browser/chromeos/options/wifi_config_view.h"
15 #include "ui/views/controls/button/button.h"
16 #include "ui/views/controls/textfield/textfield_controller.h"
17 #include "ui/views/view.h"
22 class ToggleImageButton
;
27 // A dialog box for showing a password textfield.
28 class WimaxConfigView
: public ChildNetworkConfigView
,
29 public views::TextfieldController
,
30 public views::ButtonListener
{
32 // Wimax login dialog for wimax network |wimax|. |wimax| must be a non NULL
33 // pointer to a WimaxNetwork in NetworkLibrary.
34 WimaxConfigView(NetworkConfigView
* parent
, WimaxNetwork
* wimax
);
35 virtual ~WimaxConfigView();
37 // views::TextfieldController:
38 virtual void ContentsChanged(views::Textfield
* sender
,
39 const string16
& new_contents
) OVERRIDE
;
40 virtual bool HandleKeyEvent(views::Textfield
* sender
,
41 const ui::KeyEvent
& key_event
) OVERRIDE
;
43 // views::ButtonListener:
44 virtual void ButtonPressed(views::Button
* sender
,
45 const ui::Event
& event
) OVERRIDE
;
47 // ChildNetworkConfigView:
48 virtual views::View
* GetInitiallyFocusedView() OVERRIDE
;
49 virtual bool CanLogin() OVERRIDE
;
50 virtual bool Login() OVERRIDE
;
51 virtual void Cancel() OVERRIDE
;
52 virtual void InitFocus() OVERRIDE
;
55 void Init(WimaxNetwork
* wimax
);
58 std::string
GetEapIdentity() const;
59 std::string
GetEapPassphrase() const;
60 bool GetSaveCredentials() const;
61 bool GetShareNetwork(bool share_default
) const;
63 // Updates state of the Login button.
64 void UpdateDialogButtons();
66 // Updates the error text label.
67 void UpdateErrorLabel();
69 NetworkPropertyUIData identity_ui_data_
;
70 NetworkPropertyUIData passphrase_ui_data_
;
71 NetworkPropertyUIData save_credentials_ui_data_
;
73 views::Label
* identity_label_
;
74 views::Textfield
* identity_textfield_
;
75 views::Checkbox
* save_credentials_checkbox_
;
76 views::Checkbox
* share_network_checkbox_
;
77 views::Label
* shared_network_label_
;
78 views::Label
* passphrase_label_
;
79 views::Textfield
* passphrase_textfield_
;
80 views::ToggleImageButton
* passphrase_visible_button_
;
81 views::Label
* error_label_
;
83 DISALLOW_COPY_AND_ASSIGN(WimaxConfigView
);
86 } // namespace chromeos
88 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_