OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string16.h" |
| 15 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 16 #include "chrome/browser/chromeos/options/wifi_config_view.h" |
| 17 #include "ui/views/controls/button/button.h" |
| 18 #include "ui/views/controls/textfield/textfield_controller.h" |
| 19 #include "ui/views/view.h" |
| 20 |
| 21 namespace views { |
| 22 class Checkbox; |
| 23 class Label; |
| 24 class ToggleImageButton; |
| 25 } |
| 26 |
| 27 namespace chromeos { |
| 28 |
| 29 // A dialog box for showing a password textfield. |
| 30 class WimaxConfigView : public ChildNetworkConfigView, |
| 31 public views::TextfieldController, |
| 32 public views::ButtonListener { |
| 33 public: |
| 34 // Wimax login dialog for wimax network |wimax|. |wimax| must be a non NULL |
| 35 // pointer to a WimaxNetwork in NetworkLibrary. |
| 36 WimaxConfigView(NetworkConfigView* parent, WimaxNetwork* wimax); |
| 37 virtual ~WimaxConfigView(); |
| 38 |
| 39 // views::TextfieldController: |
| 40 virtual void ContentsChanged(views::Textfield* sender, |
| 41 const string16& new_contents) OVERRIDE; |
| 42 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 43 const views::KeyEvent& key_event) OVERRIDE; |
| 44 |
| 45 // views::ButtonListener: |
| 46 virtual void ButtonPressed(views::Button* sender, |
| 47 const views::Event& event) OVERRIDE; |
| 48 |
| 49 // ChildNetworkConfigView: |
| 50 virtual string16 GetTitle() OVERRIDE; |
| 51 virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
| 52 virtual bool CanLogin() OVERRIDE; |
| 53 virtual bool Login() OVERRIDE; |
| 54 virtual void Cancel() OVERRIDE; |
| 55 virtual void InitFocus() OVERRIDE; |
| 56 |
| 57 private: |
| 58 void Init(WimaxNetwork* wimax); |
| 59 |
| 60 // Get input values. |
| 61 std::string GetEapIdentity() const; |
| 62 std::string GetEapPassphrase() const; |
| 63 bool GetSaveCredentials() const; |
| 64 bool GetShareNetwork(bool share_default) const; |
| 65 |
| 66 // Updates state of the Login button. |
| 67 void UpdateDialogButtons(); |
| 68 |
| 69 // Enable/Disable "share this network" checkbox. |
| 70 void RefreshShareCheckbox(); |
| 71 |
| 72 // Updates the error text label. |
| 73 void UpdateErrorLabel(); |
| 74 |
| 75 NetworkPropertyUIData identity_ui_data_; |
| 76 NetworkPropertyUIData passphrase_ui_data_; |
| 77 NetworkPropertyUIData save_credentials_ui_data_; |
| 78 |
| 79 views::Label* identity_label_; |
| 80 views::Textfield* identity_textfield_; |
| 81 views::Checkbox* save_credentials_checkbox_; |
| 82 views::Checkbox* share_network_checkbox_; |
| 83 views::Label* shared_network_label_; |
| 84 views::Label* passphrase_label_; |
| 85 views::Textfield* passphrase_textfield_; |
| 86 views::ToggleImageButton* passphrase_visible_button_; |
| 87 views::Label* error_label_; |
| 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(WimaxConfigView); |
| 90 }; |
| 91 |
| 92 } // namespace chromeos |
| 93 |
| 94 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIMAX_CONFIG_VIEW_H_ |
OLD | NEW |