| 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_VPN_CONFIG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "chrome/browser/chromeos/cros/cert_library.h" | 12 #include "chrome/browser/chromeos/cros/cert_library.h" |
| 13 #include "chrome/browser/chromeos/options/network_config_view.h" | 13 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 14 #include "chrome/browser/ui/select_file_dialog.h" | 14 #include "chrome/browser/ui/select_file_dialog.h" |
| 15 #include "views/controls/button/button.h" | 15 #include "views/controls/button/button.h" |
| 16 #include "views/controls/combobox/combobox.h" | 16 #include "views/controls/combobox/combobox_listener.h" |
| 17 #include "views/controls/textfield/textfield_controller.h" | 17 #include "views/controls/textfield/textfield_controller.h" |
| 18 #include "views/view.h" | 18 #include "views/view.h" |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class Label; | 21 class Label; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace chromeos { | 24 namespace chromeos { |
| 25 | 25 |
| 26 // A dialog box to allow configuration of VPN connection. | 26 // A dialog box to allow configuration of VPN connection. |
| 27 class VPNConfigView : public ChildNetworkConfigView, | 27 class VPNConfigView : public ChildNetworkConfigView, |
| 28 public views::TextfieldController, | 28 public views::TextfieldController, |
| 29 public views::ButtonListener, | 29 public views::ButtonListener, |
| 30 public views::Combobox::Listener, | 30 public views::ComboboxListener, |
| 31 public CertLibrary::Observer { | 31 public CertLibrary::Observer { |
| 32 public: | 32 public: |
| 33 VPNConfigView(NetworkConfigView* parent, VirtualNetwork* vpn); | 33 VPNConfigView(NetworkConfigView* parent, VirtualNetwork* vpn); |
| 34 explicit VPNConfigView(NetworkConfigView* parent); | 34 explicit VPNConfigView(NetworkConfigView* parent); |
| 35 virtual ~VPNConfigView(); | 35 virtual ~VPNConfigView(); |
| 36 | 36 |
| 37 // views::TextfieldController methods. | 37 // views::TextfieldController: |
| 38 virtual void ContentsChanged( | 38 virtual void ContentsChanged(views::Textfield* sender, |
| 39 views::Textfield* sender, const string16& new_contents) OVERRIDE; | 39 const string16& new_contents) OVERRIDE; |
| 40 virtual bool HandleKeyEvent( | 40 virtual bool HandleKeyEvent(views::Textfield* sender, |
| 41 views::Textfield* sender, const views::KeyEvent& key_event) OVERRIDE; | 41 const views::KeyEvent& key_event) OVERRIDE; |
| 42 | 42 |
| 43 // views::ButtonListener | 43 // views::ButtonListener: |
| 44 virtual void ButtonPressed( | 44 virtual void ButtonPressed(views::Button* sender, |
| 45 views::Button* sender, const views::Event& event) OVERRIDE; | 45 const views::Event& event) OVERRIDE; |
| 46 | 46 |
| 47 // views::Combobox::Listener | 47 // views::ComboboxListener: |
| 48 virtual void ItemChanged( | 48 virtual void ItemChanged(views::Combobox* combo_box, |
| 49 views::Combobox* combo_box, int prev_index, int new_index) OVERRIDE; | 49 int prev_index, |
| 50 int new_index) OVERRIDE; |
| 50 | 51 |
| 51 // CertLibrary::Observer: | 52 // CertLibrary::Observer: |
| 52 virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; | 53 virtual void OnCertificatesLoaded(bool initial_load) OVERRIDE; |
| 53 | 54 |
| 54 // ChildNetworkConfigView implementation. | 55 // ChildNetworkConfigView: |
| 55 virtual string16 GetTitle() OVERRIDE; | 56 virtual string16 GetTitle() OVERRIDE; |
| 56 virtual bool CanLogin() OVERRIDE; | 57 virtual bool CanLogin() OVERRIDE; |
| 57 virtual bool Login() OVERRIDE; | 58 virtual bool Login() OVERRIDE; |
| 58 virtual void Cancel() OVERRIDE; | 59 virtual void Cancel() OVERRIDE; |
| 59 virtual void InitFocus() OVERRIDE; | 60 virtual void InitFocus() OVERRIDE; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 // Initializes data members and create UI controls. | 63 // Initializes data members and create UI controls. |
| 63 void Init(VirtualNetwork* vpn); | 64 void Init(VirtualNetwork* vpn); |
| 64 | 65 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 views::Label* group_name_label_; | 132 views::Label* group_name_label_; |
| 132 views::Textfield* group_name_textfield_; | 133 views::Textfield* group_name_textfield_; |
| 133 views::Label* error_label_; | 134 views::Label* error_label_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); | 136 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace chromeos | 139 } // namespace chromeos |
| 139 | 140 |
| 140 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 141 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
| OLD | NEW |