| Index: chrome/browser/chromeos/options/vpn_config_view.cc
|
| diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc
|
| index 6b0199f73b73dcc375c5e2112cd4898c4c52f8ed..ee6204c59782243f14b738c541962790fb398eb7 100644
|
| --- a/chrome/browser/chromeos/options/vpn_config_view.cc
|
| +++ b/chrome/browser/chromeos/options/vpn_config_view.cc
|
| @@ -14,6 +14,8 @@
|
| #include "chrome/browser/chromeos/enrollment_dialog_view.h"
|
| #include "chrome/browser/chromeos/net/shill_error.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "chrome/browser/ui/views/harmony/layout_delegate.h"
|
| +#include "chrome/browser/ui/views/layout_utils.h"
|
| #include "chrome/common/net/x509_certificate_model.h"
|
| #include "chrome/grit/generated_resources.h"
|
| #include "chromeos/login/login_state.h"
|
| @@ -34,7 +36,6 @@
|
| #include "ui/views/controls/label.h"
|
| #include "ui/views/controls/textfield/textfield.h"
|
| #include "ui/views/layout/grid_layout.h"
|
| -#include "ui/views/layout/layout_constants.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/window/dialog_client_view.h"
|
|
|
| @@ -503,8 +504,8 @@ void VPNConfigView::Init() {
|
| GetNetworkState(service_path_);
|
| DCHECK(vpn && vpn->type() == shill::kTypeVPN);
|
| }
|
| - layout_ = views::GridLayout::CreatePanel(this);
|
| - SetLayoutManager(layout_);
|
| + layout_ = layout_utils::CreatePanelLayout(this);
|
| + LayoutDelegate* delegate = LayoutDelegate::Get();
|
|
|
| // Observer any changes to the certificate list.
|
| CertLibrary::Get()->AddObserver(this);
|
| @@ -513,12 +514,16 @@ void VPNConfigView::Init() {
|
| // Label.
|
| column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1,
|
| views::GridLayout::USE_PREF, 0, 0);
|
| - column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing);
|
| + column_set->AddPaddingColumn(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING));
|
| // Textfield, combobox.
|
| column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
|
| views::GridLayout::USE_PREF, 0,
|
| ChildNetworkConfigView::kInputFieldMinWidth);
|
| - column_set->AddPaddingColumn(0, views::kRelatedControlSmallHorizontalSpacing);
|
| + column_set->AddPaddingColumn(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING));
|
| // Policy indicator.
|
| column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, 0,
|
| views::GridLayout::USE_PREF, 0, 0);
|
| @@ -543,7 +548,9 @@ void VPNConfigView::Init() {
|
| server_textfield_ = new views::Textfield();
|
| server_textfield_->set_controller(this);
|
| layout_->AddView(server_textfield_);
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
| if (!service_path_.empty()) {
|
| server_label->SetEnabled(false);
|
| server_textfield_->SetEnabled(false);
|
| @@ -564,7 +571,9 @@ void VPNConfigView::Init() {
|
| layout_->AddView(service_text_);
|
| service_textfield_ = NULL;
|
| }
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // Provider type label and select.
|
| layout_->StartRow(0, 0);
|
| @@ -584,7 +593,9 @@ void VPNConfigView::Init() {
|
| layout_->AddView(provider_type_text_label_);
|
| provider_type_combobox_ = NULL;
|
| }
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // PSK passphrase label, input and visible button.
|
| layout_->StartRow(0, 0);
|
| @@ -596,7 +607,9 @@ void VPNConfigView::Init() {
|
| layout_->AddView(psk_passphrase_textfield_);
|
| layout_->AddView(
|
| new ControlledSettingIndicatorView(psk_passphrase_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // Server CA certificate
|
| if (service_path_.empty()) {
|
| @@ -610,7 +623,9 @@ void VPNConfigView::Init() {
|
| server_ca_cert_combobox_model_.get());
|
| layout_->AddView(server_ca_cert_combobox_);
|
| layout_->AddView(new ControlledSettingIndicatorView(ca_cert_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
| } else {
|
| server_ca_cert_label_ = NULL;
|
| server_ca_cert_combobox_ = NULL;
|
| @@ -627,7 +642,9 @@ void VPNConfigView::Init() {
|
| user_cert_combobox_->set_listener(this);
|
| layout_->AddView(user_cert_combobox_);
|
| layout_->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // Username label and input.
|
| layout_->StartRow(0, 0);
|
| @@ -638,7 +655,9 @@ void VPNConfigView::Init() {
|
| username_textfield_->SetEnabled(username_ui_data_.IsEditable());
|
| layout_->AddView(username_textfield_);
|
| layout_->AddView(new ControlledSettingIndicatorView(username_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // User passphrase label, input and visble button.
|
| layout_->StartRow(0, 0);
|
| @@ -650,7 +669,9 @@ void VPNConfigView::Init() {
|
| layout_->AddView(user_passphrase_textfield_);
|
| layout_->AddView(
|
| new ControlledSettingIndicatorView(user_passphrase_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // OTP label and input.
|
| layout_->StartRow(0, 0);
|
| @@ -660,7 +681,9 @@ void VPNConfigView::Init() {
|
| otp_textfield_ = new views::Textfield();
|
| otp_textfield_->set_controller(this);
|
| layout_->AddView(otp_textfield_);
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // Group Name label and input.
|
| layout_->StartRow(0, 0);
|
| @@ -672,7 +695,9 @@ void VPNConfigView::Init() {
|
| group_name_textfield_->set_controller(this);
|
| layout_->AddView(group_name_textfield_);
|
| layout_->AddView(new ControlledSettingIndicatorView(group_name_ui_data_));
|
| - layout_->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout_->AddPaddingRow(
|
| + 0, delegate->GetMetric(
|
| + LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| // Save credentials
|
| layout_->StartRow(0, 0);
|
|
|