| OLD | NEW |
| 1 // Copyright (c) 2010 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/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/chromeos/cros/network_library.h" | 13 #include "chrome/browser/chromeos/cros/network_library.h" |
| 14 #include "chrome/browser/ui/shell_dialogs.h" | 14 #include "chrome/browser/ui/shell_dialogs.h" |
| 15 #include "ui/base/models/combobox_model.h" | 15 #include "ui/base/models/combobox_model.h" |
| 16 #include "views/controls/button/button.h" | 16 #include "views/controls/button/button.h" |
| 17 #include "views/controls/button/checkbox.h" | 17 #include "views/controls/button/checkbox.h" |
| 18 #include "views/controls/button/image_button.h" | 18 #include "views/controls/button/image_button.h" |
| 19 #include "views/controls/button/native_button.h" | 19 #include "views/controls/button/native_button.h" |
| 20 #include "views/controls/combobox/combobox.h" | 20 #include "views/controls/combobox/combobox.h" |
| 21 #include "views/controls/textfield/textfield.h" | 21 #include "views/controls/textfield/textfield_controller.h" |
| 22 #include "views/view.h" | 22 #include "views/view.h" |
| 23 | 23 |
| 24 class FilePath; | 24 class FilePath; |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 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::TextfieldController, |
| 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 // Wifi login dialog for wifi network |wifi| |
| 38 WifiConfigView(NetworkConfigView* parent, const WifiNetwork* wifi); | 38 WifiConfigView(NetworkConfigView* parent, const WifiNetwork* wifi); |
| 39 // Wifi login dialog for "Joining other network..." | 39 // Wifi login dialog for "Joining other network..." |
| 40 explicit WifiConfigView(NetworkConfigView* parent); | 40 explicit WifiConfigView(NetworkConfigView* parent); |
| 41 virtual ~WifiConfigView(); | 41 virtual ~WifiConfigView(); |
| 42 | 42 |
| 43 // views::Textfield::Controller methods. | 43 // views::TextfieldController: |
| 44 virtual void ContentsChanged(views::Textfield* sender, | 44 virtual void ContentsChanged(views::Textfield* sender, |
| 45 const string16& new_contents); | 45 const string16& new_contents); |
| 46 virtual bool HandleKeyEvent(views::Textfield* sender, | 46 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 47 const views::KeyEvent& key_event); | 47 const views::KeyEvent& key_event); |
| 48 | 48 |
| 49 // views::ButtonListener | 49 // views::ButtonListener: |
| 50 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 50 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
| 51 | 51 |
| 52 // views::Combobox::Listener | 52 // views::Combobox::Listener: |
| 53 virtual void ItemChanged(views::Combobox* combo_box, | 53 virtual void ItemChanged(views::Combobox* combo_box, |
| 54 int prev_index, int new_index); | 54 int prev_index, int new_index); |
| 55 | 55 |
| 56 // SelectFileDialog::Listener implementation. | 56 // SelectFileDialog::Listener: |
| 57 virtual void FileSelected(const FilePath& path, int index, void* params); | 57 virtual void FileSelected(const FilePath& path, int index, void* params); |
| 58 | 58 |
| 59 // Login to network. Returns false if the dialog should remain open. | 59 // Login to network. Returns false if the dialog should remain open. |
| 60 virtual bool Login(); | 60 virtual bool Login(); |
| 61 | 61 |
| 62 // Save network information. | 62 // Save network information. |
| 63 virtual bool Save(); | 63 virtual bool Save(); |
| 64 | 64 |
| 65 // Cancel the dialog. | 65 // Cancel the dialog. |
| 66 virtual void Cancel(); | 66 virtual void Cancel(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 views::Textfield* passphrase_textfield_; | 102 views::Textfield* passphrase_textfield_; |
| 103 views::ImageButton* passphrase_visible_button_; | 103 views::ImageButton* passphrase_visible_button_; |
| 104 views::Label* error_label_; | 104 views::Label* error_label_; |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); | 106 DISALLOW_COPY_AND_ASSIGN(WifiConfigView); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace chromeos | 109 } // namespace chromeos |
| 110 | 110 |
| 111 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ | 111 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_WIFI_CONFIG_VIEW_H_ |
| OLD | NEW |