Chromium Code Reviews| 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 5c443860e6af5aab2bc1b7f1131dd92e7d060d3b..26dcaa3a7b07c96b0b5d7aab027c856c56edda65 100644 |
| --- a/chrome/browser/chromeos/options/vpn_config_view.cc |
| +++ b/chrome/browser/chromeos/options/vpn_config_view.cc |
| @@ -14,7 +14,6 @@ |
| #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/common/net/x509_certificate_model.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "chromeos/login/login_state.h" |
| @@ -35,6 +34,7 @@ |
| #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_delegate.h" |
| #include "ui/views/widget/widget.h" |
| #include "ui/views/window/dialog_client_view.h" |
| @@ -503,8 +503,9 @@ void VPNConfigView::Init() { |
| GetNetworkState(service_path_); |
| DCHECK(vpn && vpn->type() == shill::kTypeVPN); |
| } |
| + |
| layout_ = views::GridLayout::CreatePanel(this); |
| - LayoutDelegate* delegate = LayoutDelegate::Get(); |
| + views::LayoutDelegate* delegate = views::LayoutDelegate::Get(); |
| // Observer any changes to the certificate list. |
| CertLibrary::Get()->AddObserver(this); |
| @@ -514,15 +515,15 @@ void VPNConfigView::Init() { |
| column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, |
| views::GridLayout::USE_PREF, 0, 0); |
| column_set->AddPaddingColumn( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); |
| + 0, delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_HORIZONTAL)); |
|
Peter Kasting
2017/04/06 08:13:36
Seems like all these views::DistanceMetric:: value
kylix_rd
2017/04/06 16:48:19
I was looking to ensure consistency (by example) w
|
| // Textfield, combobox. |
| column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| views::GridLayout::USE_PREF, 0, |
| ChildNetworkConfigView::kInputFieldMinWidth); |
| column_set->AddPaddingColumn( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); |
| + 0, delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_HORIZONTAL)); |
| // Policy indicator. |
| column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, 0, |
| views::GridLayout::USE_PREF, 0, 0); |
| @@ -547,9 +548,9 @@ void VPNConfigView::Init() { |
| server_textfield_ = new views::Textfield(); |
| server_textfield_->set_controller(this); |
| layout_->AddView(server_textfield_); |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| if (!service_path_.empty()) { |
| server_label->SetEnabled(false); |
| server_textfield_->SetEnabled(false); |
| @@ -570,9 +571,9 @@ void VPNConfigView::Init() { |
| layout_->AddView(service_text_); |
| service_textfield_ = NULL; |
| } |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // Provider type label and select. |
| layout_->StartRow(0, 0); |
| @@ -592,9 +593,9 @@ void VPNConfigView::Init() { |
| layout_->AddView(provider_type_text_label_); |
| provider_type_combobox_ = NULL; |
| } |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // PSK passphrase label, input and visible button. |
| layout_->StartRow(0, 0); |
| @@ -606,9 +607,9 @@ void VPNConfigView::Init() { |
| layout_->AddView(psk_passphrase_textfield_); |
| layout_->AddView( |
| new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // Server CA certificate |
| if (service_path_.empty()) { |
| @@ -623,8 +624,8 @@ void VPNConfigView::Init() { |
| layout_->AddView(server_ca_cert_combobox_); |
| layout_->AddView(new ControlledSettingIndicatorView(ca_cert_ui_data_)); |
| layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + 0, delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| } else { |
| server_ca_cert_label_ = NULL; |
| server_ca_cert_combobox_ = NULL; |
| @@ -641,9 +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, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // Username label and input. |
| layout_->StartRow(0, 0); |
| @@ -654,9 +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, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // User passphrase label, input and visble button. |
| layout_->StartRow(0, 0); |
| @@ -668,9 +669,9 @@ void VPNConfigView::Init() { |
| layout_->AddView(user_passphrase_textfield_); |
| layout_->AddView( |
| new ControlledSettingIndicatorView(user_passphrase_ui_data_)); |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // OTP label and input. |
| layout_->StartRow(0, 0); |
| @@ -680,9 +681,9 @@ void VPNConfigView::Init() { |
| otp_textfield_ = new views::Textfield(); |
| otp_textfield_->set_controller(this); |
| layout_->AddView(otp_textfield_); |
| - layout_->AddPaddingRow( |
| - 0, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // Group Name label and input. |
| layout_->StartRow(0, 0); |
| @@ -694,9 +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, delegate->GetMetric( |
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); |
| + layout_->AddPaddingRow(0, |
| + delegate->GetDistanceMetric( |
| + views::DistanceMetric::RELATED_CONTROL_VERTICAL)); |
| // Save credentials |
| layout_->StartRow(0, 0); |