Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Deleted LayoutDelegate and HarmonyLayoutDelegate. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ee6204c59782243f14b738c541962790fb398eb7..705c57af22a2f36a4f5a81c4d948b7f12455c984 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/browser/ui/views/layout_utils.h"
#include "chrome/common/net/x509_certificate_model.h"
#include "chrome/grit/generated_resources.h"
@@ -36,6 +35,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/views_layout_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
@@ -505,7 +505,7 @@ void VPNConfigView::Init() {
DCHECK(vpn && vpn->type() == shill::kTypeVPN);
}
layout_ = layout_utils::CreatePanelLayout(this);
- LayoutDelegate* delegate = LayoutDelegate::Get();
+ views::ViewsLayoutDelegate* delegate = views::ViewsLayoutDelegate::Get();
// Observer any changes to the certificate list.
CertLibrary::Get()->AddObserver(this);
@@ -515,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));
// 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);
@@ -548,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);
@@ -571,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);
@@ -593,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);
@@ -607,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()) {
@@ -624,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;
@@ -642,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);
@@ -655,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);
@@ -669,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);
@@ -681,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);
@@ -695,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);

Powered by Google App Engine
This is Rietveld 408576698