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 "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 } | 475 } |
476 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 476 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
477 | 477 |
478 // PSK passphrase label, input and visible button. | 478 // PSK passphrase label, input and visible button. |
479 if (enable_psk_passphrase_) { | 479 if (enable_psk_passphrase_) { |
480 layout->StartRow(0, column_view_set_id); | 480 layout->StartRow(0, column_view_set_id); |
481 psk_passphrase_label_ = new views::Label(l10n_util::GetStringUTF16( | 481 psk_passphrase_label_ = new views::Label(l10n_util::GetStringUTF16( |
482 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_PSK_PASSPHRASE)); | 482 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_PSK_PASSPHRASE)); |
483 layout->AddView(psk_passphrase_label_); | 483 layout->AddView(psk_passphrase_label_); |
484 psk_passphrase_textfield_ = new views::Textfield( | 484 psk_passphrase_textfield_ = new views::Textfield( |
485 views::Textfield::STYLE_PASSWORD); | 485 views::Textfield::STYLE_OBSCURED); |
486 psk_passphrase_textfield_->SetController(this); | 486 psk_passphrase_textfield_->SetController(this); |
487 if (vpn && !vpn->psk_passphrase().empty()) | 487 if (vpn && !vpn->psk_passphrase().empty()) |
488 psk_passphrase_textfield_->SetText(UTF8ToUTF16(vpn->psk_passphrase())); | 488 psk_passphrase_textfield_->SetText(UTF8ToUTF16(vpn->psk_passphrase())); |
489 layout->AddView(psk_passphrase_textfield_); | 489 layout->AddView(psk_passphrase_textfield_); |
490 layout->AddView( | 490 layout->AddView( |
491 new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); | 491 new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); |
492 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 492 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
493 } else { | 493 } else { |
494 psk_passphrase_label_ = NULL; | 494 psk_passphrase_label_ = NULL; |
495 psk_passphrase_textfield_ = NULL; | 495 psk_passphrase_textfield_ = NULL; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 username_textfield_->SetText(UTF8ToUTF16(vpn->GetUserName())); | 543 username_textfield_->SetText(UTF8ToUTF16(vpn->GetUserName())); |
544 layout->AddView(username_textfield_); | 544 layout->AddView(username_textfield_); |
545 layout->AddView(new ControlledSettingIndicatorView(username_ui_data_)); | 545 layout->AddView(new ControlledSettingIndicatorView(username_ui_data_)); |
546 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 546 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
547 | 547 |
548 // User passphrase label, input and visble button. | 548 // User passphrase label, input and visble button. |
549 layout->StartRow(0, column_view_set_id); | 549 layout->StartRow(0, column_view_set_id); |
550 layout->AddView(new views::Label(l10n_util::GetStringUTF16( | 550 layout->AddView(new views::Label(l10n_util::GetStringUTF16( |
551 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USER_PASSPHRASE))); | 551 IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_VPN_USER_PASSPHRASE))); |
552 user_passphrase_textfield_ = new views::Textfield( | 552 user_passphrase_textfield_ = new views::Textfield( |
553 views::Textfield::STYLE_PASSWORD); | 553 views::Textfield::STYLE_OBSCURED); |
554 user_passphrase_textfield_->SetController(this); | 554 user_passphrase_textfield_->SetController(this); |
555 user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.editable()); | 555 user_passphrase_textfield_->SetEnabled(user_passphrase_ui_data_.editable()); |
556 if (vpn && !vpn->user_passphrase().empty()) | 556 if (vpn && !vpn->user_passphrase().empty()) |
557 user_passphrase_textfield_->SetText(UTF8ToUTF16(vpn->user_passphrase())); | 557 user_passphrase_textfield_->SetText(UTF8ToUTF16(vpn->user_passphrase())); |
558 layout->AddView(user_passphrase_textfield_); | 558 layout->AddView(user_passphrase_textfield_); |
559 layout->AddView(new ControlledSettingIndicatorView(user_passphrase_ui_data_)); | 559 layout->AddView(new ControlledSettingIndicatorView(user_passphrase_ui_data_)); |
560 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 560 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
561 | 561 |
562 // OTP label and input. | 562 // OTP label and input. |
563 if (enable_otp_) { | 563 if (enable_otp_) { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 std::string vpn_type; | 799 std::string vpn_type; |
800 if (!vpn_dict || !vpn_dict->GetString(onc::kType, &vpn_type)) | 800 if (!vpn_dict || !vpn_dict->GetString(onc::kType, &vpn_type)) |
801 return; | 801 return; |
802 | 802 |
803 property_ui_data->ParseOncProperty( | 803 property_ui_data->ParseOncProperty( |
804 network->ui_data(), onc, | 804 network->ui_data(), onc, |
805 base::StringPrintf("%s.%s.%s", onc::kVPN, vpn_type.c_str(), key.c_str())); | 805 base::StringPrintf("%s.%s.%s", onc::kVPN, vpn_type.c_str(), key.c_str())); |
806 } | 806 } |
807 | 807 |
808 } // namespace chromeos | 808 } // namespace chromeos |
OLD | NEW |