| 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 #include "chrome/browser/chromeos/options/vpn_config_view.h" | 5 #include "chrome/browser/chromeos/options/vpn_config_view.h" |
| 6 | 6 |
| 7 #include "ash/system/chromeos/network/network_connect.h" | 7 #include "ash/system/chromeos/network/network_connect.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 enable_server_ca_cert_ = true; | 522 enable_server_ca_cert_ = true; |
| 523 enable_otp_ = true; | 523 enable_otp_ = true; |
| 524 enable_group_name_ = true; | 524 enable_group_name_ = true; |
| 525 | 525 |
| 526 // Server label and input. | 526 // Server label and input. |
| 527 layout_->StartRow(0, 0); | 527 layout_->StartRow(0, 0); |
| 528 views::View* server_label = | 528 views::View* server_label = |
| 529 new views::Label(l10n_util::GetStringUTF16( | 529 new views::Label(l10n_util::GetStringUTF16( |
| 530 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_SERVER_HOSTNAME)); | 530 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_SERVER_HOSTNAME)); |
| 531 layout_->AddView(server_label); | 531 layout_->AddView(server_label); |
| 532 server_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); | 532 server_textfield_ = new views::Textfield(); |
| 533 server_textfield_->SetController(this); | 533 server_textfield_->set_controller(this); |
| 534 layout_->AddView(server_textfield_); | 534 layout_->AddView(server_textfield_); |
| 535 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 535 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 536 if (!service_path_.empty()) { | 536 if (!service_path_.empty()) { |
| 537 server_label->SetEnabled(false); | 537 server_label->SetEnabled(false); |
| 538 server_textfield_->SetEnabled(false); | 538 server_textfield_->SetEnabled(false); |
| 539 } | 539 } |
| 540 | 540 |
| 541 // Service label and name or input. | 541 // Service label and name or input. |
| 542 layout_->StartRow(0, 0); | 542 layout_->StartRow(0, 0); |
| 543 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( | 543 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( |
| 544 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_SERVICE_NAME))); | 544 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_SERVICE_NAME))); |
| 545 if (service_path_.empty()) { | 545 if (service_path_.empty()) { |
| 546 service_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); | 546 service_textfield_ = new views::Textfield(); |
| 547 service_textfield_->SetController(this); | 547 service_textfield_->set_controller(this); |
| 548 layout_->AddView(service_textfield_); | 548 layout_->AddView(service_textfield_); |
| 549 service_text_ = NULL; | 549 service_text_ = NULL; |
| 550 } else { | 550 } else { |
| 551 service_text_ = new views::Label(); | 551 service_text_ = new views::Label(); |
| 552 service_text_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 552 service_text_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 553 layout_->AddView(service_text_); | 553 layout_->AddView(service_text_); |
| 554 service_textfield_ = NULL; | 554 service_textfield_ = NULL; |
| 555 } | 555 } |
| 556 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 556 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 557 | 557 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 574 provider_type_combobox_ = NULL; | 574 provider_type_combobox_ = NULL; |
| 575 } | 575 } |
| 576 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 576 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 577 | 577 |
| 578 // PSK passphrase label, input and visible button. | 578 // PSK passphrase label, input and visible button. |
| 579 layout_->StartRow(0, 0); | 579 layout_->StartRow(0, 0); |
| 580 psk_passphrase_label_ = new views::Label(l10n_util::GetStringUTF16( | 580 psk_passphrase_label_ = new views::Label(l10n_util::GetStringUTF16( |
| 581 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_PSK_PASSPHRASE)); | 581 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_PSK_PASSPHRASE)); |
| 582 layout_->AddView(psk_passphrase_label_); | 582 layout_->AddView(psk_passphrase_label_); |
| 583 psk_passphrase_textfield_ = new PassphraseTextfield(); | 583 psk_passphrase_textfield_ = new PassphraseTextfield(); |
| 584 psk_passphrase_textfield_->SetController(this); | 584 psk_passphrase_textfield_->set_controller(this); |
| 585 layout_->AddView(psk_passphrase_textfield_); | 585 layout_->AddView(psk_passphrase_textfield_); |
| 586 layout_->AddView( | 586 layout_->AddView( |
| 587 new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); | 587 new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); |
| 588 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 588 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 589 | 589 |
| 590 // Server CA certificate | 590 // Server CA certificate |
| 591 if (service_path_.empty()) { | 591 if (service_path_.empty()) { |
| 592 layout_->StartRow(0, 0); | 592 layout_->StartRow(0, 0); |
| 593 server_ca_cert_label_ = new views::Label(l10n_util::GetStringUTF16( | 593 server_ca_cert_label_ = new views::Label(l10n_util::GetStringUTF16( |
| 594 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_SERVER_CA)); | 594 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CERT_SERVER_CA)); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 615 user_cert_combobox_ = new views::Combobox(user_cert_combobox_model_.get()); | 615 user_cert_combobox_ = new views::Combobox(user_cert_combobox_model_.get()); |
| 616 user_cert_combobox_->set_listener(this); | 616 user_cert_combobox_->set_listener(this); |
| 617 layout_->AddView(user_cert_combobox_); | 617 layout_->AddView(user_cert_combobox_); |
| 618 layout_->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_)); | 618 layout_->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_)); |
| 619 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 619 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 620 | 620 |
| 621 // Username label and input. | 621 // Username label and input. |
| 622 layout_->StartRow(0, 0); | 622 layout_->StartRow(0, 0); |
| 623 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( | 623 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( |
| 624 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USERNAME))); | 624 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USERNAME))); |
| 625 username_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); | 625 username_textfield_ = new views::Textfield(); |
| 626 username_textfield_->SetController(this); | 626 username_textfield_->set_controller(this); |
| 627 username_textfield_->SetEnabled(username_ui_data_.IsEditable()); | 627 username_textfield_->SetEnabled(username_ui_data_.IsEditable()); |
| 628 layout_->AddView(username_textfield_); | 628 layout_->AddView(username_textfield_); |
| 629 layout_->AddView(new ControlledSettingIndicatorView(username_ui_data_)); | 629 layout_->AddView(new ControlledSettingIndicatorView(username_ui_data_)); |
| 630 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 630 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 631 | 631 |
| 632 // User passphrase label, input and visble button. | 632 // User passphrase label, input and visble button. |
| 633 layout_->StartRow(0, 0); | 633 layout_->StartRow(0, 0); |
| 634 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( | 634 layout_->AddView(new views::Label(l10n_util::GetStringUTF16( |
| 635 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USER_PASSPHRASE))); | 635 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USER_PASSPHRASE))); |
| 636 user_passphrase_textfield_ = new PassphraseTextfield(); | 636 user_passphrase_textfield_ = new PassphraseTextfield(); |
| 637 user_passphrase_textfield_->SetController(this); | 637 user_passphrase_textfield_->set_controller(this); |
| 638 user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.IsEditable()); | 638 user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.IsEditable()); |
| 639 layout_->AddView(user_passphrase_textfield_); | 639 layout_->AddView(user_passphrase_textfield_); |
| 640 layout_->AddView( | 640 layout_->AddView( |
| 641 new ControlledSettingIndicatorView(user_passphrase_ui_data_)); | 641 new ControlledSettingIndicatorView(user_passphrase_ui_data_)); |
| 642 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 642 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 643 | 643 |
| 644 // OTP label and input. | 644 // OTP label and input. |
| 645 layout_->StartRow(0, 0); | 645 layout_->StartRow(0, 0); |
| 646 otp_label_ = new views::Label(l10n_util::GetStringUTF16( | 646 otp_label_ = new views::Label(l10n_util::GetStringUTF16( |
| 647 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_OTP)); | 647 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_OTP)); |
| 648 layout_->AddView(otp_label_); | 648 layout_->AddView(otp_label_); |
| 649 otp_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); | 649 otp_textfield_ = new views::Textfield(); |
| 650 otp_textfield_->SetController(this); | 650 otp_textfield_->set_controller(this); |
| 651 layout_->AddView(otp_textfield_); | 651 layout_->AddView(otp_textfield_); |
| 652 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 652 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 653 | 653 |
| 654 // Group Name label and input. | 654 // Group Name label and input. |
| 655 layout_->StartRow(0, 0); | 655 layout_->StartRow(0, 0); |
| 656 group_name_label_ = new views::Label(l10n_util::GetStringUTF16( | 656 group_name_label_ = new views::Label(l10n_util::GetStringUTF16( |
| 657 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_GROUP_NAME)); | 657 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_GROUP_NAME)); |
| 658 layout_->AddView(group_name_label_); | 658 layout_->AddView(group_name_label_); |
| 659 group_name_textfield_ = | 659 group_name_textfield_ = |
| 660 new views::Textfield(views::Textfield::STYLE_DEFAULT); | 660 new views::Textfield(); |
| 661 group_name_textfield_->SetController(this); | 661 group_name_textfield_->set_controller(this); |
| 662 layout_->AddView(group_name_textfield_); | 662 layout_->AddView(group_name_textfield_); |
| 663 layout_->AddView(new ControlledSettingIndicatorView(group_name_ui_data_)); | 663 layout_->AddView(new ControlledSettingIndicatorView(group_name_ui_data_)); |
| 664 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 664 layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 665 | 665 |
| 666 // Save credentials | 666 // Save credentials |
| 667 layout_->StartRow(0, 0); | 667 layout_->StartRow(0, 0); |
| 668 save_credentials_checkbox_ = new views::Checkbox( | 668 save_credentials_checkbox_ = new views::Checkbox( |
| 669 l10n_util::GetStringUTF16( | 669 l10n_util::GetStringUTF16( |
| 670 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS)); | 670 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SAVE_CREDENTIALS)); |
| 671 save_credentials_checkbox_->SetEnabled( | 671 save_credentials_checkbox_->SetEnabled( |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 property_ui_data->ParseOncProperty( | 1052 property_ui_data->ParseOncProperty( |
| 1053 onc_source, | 1053 onc_source, |
| 1054 onc, | 1054 onc, |
| 1055 base::StringPrintf("%s.%s.%s", | 1055 base::StringPrintf("%s.%s.%s", |
| 1056 ::onc::network_config::kVPN, | 1056 ::onc::network_config::kVPN, |
| 1057 dict_key.c_str(), | 1057 dict_key.c_str(), |
| 1058 key.c_str())); | 1058 key.c_str())); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 } // namespace chromeos | 1061 } // namespace chromeos |
| OLD | NEW |