| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "chrome/browser/chromeos/options/cert_library.h" | 13 #include "chrome/browser/chromeos/options/cert_library.h" |
| 14 #include "chrome/browser/chromeos/options/network_config_view.h" | 14 #include "chrome/browser/chromeos/options/network_config_view.h" |
| 15 #include "chrome/browser/chromeos/options/network_property_ui_data.h" | 15 #include "chrome/browser/chromeos/options/network_property_ui_data.h" |
| 16 #include "chrome/browser/chromeos/options/passphrase_textfield.h" | 16 #include "chrome/browser/chromeos/options/passphrase_textfield.h" |
| 17 #include "chromeos/network/client_cert_util.h" | 17 #include "chromeos/network/client_cert_util.h" |
| 18 #include "ui/views/controls/button/button.h" | 18 #include "ui/views/controls/button/button.h" |
| 19 #include "ui/views/controls/combobox/combobox_listener.h" | 19 #include "ui/views/controls/combobox/combobox_listener.h" |
| 20 #include "ui/views/controls/textfield/textfield_controller.h" | 20 #include "ui/views/controls/textfield/textfield_controller.h" |
| 21 #include "ui/views/view.h" | 21 #include "ui/views/view.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 // Initializes data members and create UI controls. | 77 // Initializes data members and create UI controls. |
| 78 void Init(); | 78 void Init(); |
| 79 | 79 |
| 80 // Callback to initialize fields from uncached network properties. | 80 // Callback to initialize fields from uncached network properties. |
| 81 void InitFromProperties(const std::string& service_path, | 81 void InitFromProperties(const std::string& service_path, |
| 82 const base::DictionaryValue& dictionary); | 82 const base::DictionaryValue& dictionary); |
| 83 void ParseUIProperties(const NetworkState* vpn); | 83 void ParseUIProperties(const NetworkState* vpn); |
| 84 void GetPropertiesError(const std::string& error_name, | 84 void GetPropertiesError(const std::string& error_name, |
| 85 scoped_ptr<base::DictionaryValue> error_data); | 85 std::unique_ptr<base::DictionaryValue> error_data); |
| 86 | 86 |
| 87 // Fill in |properties| with the properties for the selected client (user) | 87 // Fill in |properties| with the properties for the selected client (user) |
| 88 // certificate or empty properties if no client cert is required. | 88 // certificate or empty properties if no client cert is required. |
| 89 void SetUserCertProperties(chromeos::client_cert::ConfigType client_cert_type, | 89 void SetUserCertProperties(chromeos::client_cert::ConfigType client_cert_type, |
| 90 base::DictionaryValue* properties) const; | 90 base::DictionaryValue* properties) const; |
| 91 | 91 |
| 92 // Helper function to set configurable properties. | 92 // Helper function to set configurable properties. |
| 93 void SetConfigProperties(base::DictionaryValue* properties); | 93 void SetConfigProperties(base::DictionaryValue* properties); |
| 94 | 94 |
| 95 // Set and update all control values. | 95 // Set and update all control values. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 NetworkPropertyUIData user_passphrase_ui_data_; | 156 NetworkPropertyUIData user_passphrase_ui_data_; |
| 157 NetworkPropertyUIData group_name_ui_data_; | 157 NetworkPropertyUIData group_name_ui_data_; |
| 158 NetworkPropertyUIData save_credentials_ui_data_; | 158 NetworkPropertyUIData save_credentials_ui_data_; |
| 159 | 159 |
| 160 int title_; | 160 int title_; |
| 161 | 161 |
| 162 views::GridLayout* layout_; | 162 views::GridLayout* layout_; |
| 163 views::Textfield* server_textfield_; | 163 views::Textfield* server_textfield_; |
| 164 views::Label* service_text_; | 164 views::Label* service_text_; |
| 165 views::Textfield* service_textfield_; | 165 views::Textfield* service_textfield_; |
| 166 scoped_ptr<internal::ProviderTypeComboboxModel> provider_type_combobox_model_; | 166 std::unique_ptr<internal::ProviderTypeComboboxModel> |
| 167 provider_type_combobox_model_; |
| 167 views::Combobox* provider_type_combobox_; | 168 views::Combobox* provider_type_combobox_; |
| 168 views::Label* provider_type_text_label_; | 169 views::Label* provider_type_text_label_; |
| 169 views::Label* psk_passphrase_label_; | 170 views::Label* psk_passphrase_label_; |
| 170 PassphraseTextfield* psk_passphrase_textfield_; | 171 PassphraseTextfield* psk_passphrase_textfield_; |
| 171 views::Label* user_cert_label_; | 172 views::Label* user_cert_label_; |
| 172 scoped_ptr<internal::VpnUserCertComboboxModel> user_cert_combobox_model_; | 173 std::unique_ptr<internal::VpnUserCertComboboxModel> user_cert_combobox_model_; |
| 173 views::Combobox* user_cert_combobox_; | 174 views::Combobox* user_cert_combobox_; |
| 174 views::Label* server_ca_cert_label_; | 175 views::Label* server_ca_cert_label_; |
| 175 scoped_ptr<internal::VpnServerCACertComboboxModel> | 176 std::unique_ptr<internal::VpnServerCACertComboboxModel> |
| 176 server_ca_cert_combobox_model_; | 177 server_ca_cert_combobox_model_; |
| 177 views::Combobox* server_ca_cert_combobox_; | 178 views::Combobox* server_ca_cert_combobox_; |
| 178 views::Textfield* username_textfield_; | 179 views::Textfield* username_textfield_; |
| 179 PassphraseTextfield* user_passphrase_textfield_; | 180 PassphraseTextfield* user_passphrase_textfield_; |
| 180 views::Label* otp_label_; | 181 views::Label* otp_label_; |
| 181 views::Textfield* otp_textfield_; | 182 views::Textfield* otp_textfield_; |
| 182 views::Label* group_name_label_; | 183 views::Label* group_name_label_; |
| 183 views::Textfield* group_name_textfield_; | 184 views::Textfield* group_name_textfield_; |
| 184 views::Checkbox* save_credentials_checkbox_; | 185 views::Checkbox* save_credentials_checkbox_; |
| 185 views::Label* error_label_; | 186 views::Label* error_label_; |
| 186 | 187 |
| 187 // Cached VPN properties, only set when configuring an existing network. | 188 // Cached VPN properties, only set when configuring an existing network. |
| 188 int provider_type_index_; | 189 int provider_type_index_; |
| 189 std::string ca_cert_pem_; | 190 std::string ca_cert_pem_; |
| 190 std::string client_cert_id_; | 191 std::string client_cert_id_; |
| 191 | 192 |
| 192 base::WeakPtrFactory<VPNConfigView> weak_ptr_factory_; | 193 base::WeakPtrFactory<VPNConfigView> weak_ptr_factory_; |
| 193 | 194 |
| 194 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); | 195 DISALLOW_COPY_AND_ASSIGN(VPNConfigView); |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 } // namespace chromeos | 198 } // namespace chromeos |
| 198 | 199 |
| 199 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ | 200 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_VPN_CONFIG_VIEW_H_ |
| OLD | NEW |