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

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

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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/wifi_config_view.cc
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index 2ce524b226eb724ca7a3606be668b89a23df4bcb..c1a5cd0e9466954b17c5e8857a6481ecf7e985bd 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -17,7 +17,6 @@
#include "chrome/browser/chromeos/net/shill_error.h"
#include "chrome/browser/chromeos/options/passphrase_textfield.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "chromeos/login/login_state.h"
@@ -43,6 +42,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_provider.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
@@ -939,7 +939,7 @@ void WifiConfigView::Init(bool show_8021x) {
}
views::GridLayout* layout = views::GridLayout::CreatePanel(this);
- LayoutDelegate* delegate = LayoutDelegate::Get();
+ views::LayoutProvider* provider = views::LayoutProvider::Get();
const int column_view_set_id = 0;
views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id);
@@ -956,15 +956,15 @@ void WifiConfigView::Init(bool show_8021x) {
1, views::GridLayout::USE_PREF, 0, 0);
}
column_set->AddPaddingColumn(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING));
+ 0,
+ provider->GetDistanceMetric(views::DISTANCE_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,
+ provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL));
// Password visible button / policy indicator.
column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 0,
views::GridLayout::FIXED, kPasswordVisibleWidth, 0);
@@ -992,9 +992,8 @@ void WifiConfigView::Init(bool show_8021x) {
label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
layout->AddView(label);
}
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
}
// Security select
@@ -1015,9 +1014,8 @@ void WifiConfigView::Init(bool show_8021x) {
layout->AddView(security_combobox_);
}
layout->AddView(security_combobox_);
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
}
// Only enumerate certificates in the data model for 802.1X networks.
@@ -1044,9 +1042,8 @@ void WifiConfigView::Init(bool show_8021x) {
layout->AddView(eap_method_combobox_);
}
layout->AddView(new ControlledSettingIndicatorView(eap_method_ui_data_));
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
// Phase 2 authentication
layout->StartRow(0, column_view_set_id);
@@ -1070,9 +1067,8 @@ void WifiConfigView::Init(bool show_8021x) {
layout->AddView(phase_2_auth_combobox_);
}
layout->AddView(new ControlledSettingIndicatorView(phase_2_auth_ui_data_));
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
// Server CA certificate
layout->StartRow(0, column_view_set_id);
@@ -1098,9 +1094,8 @@ void WifiConfigView::Init(bool show_8021x) {
}
layout->AddView(
new ControlledSettingIndicatorView(server_ca_cert_ui_data_));
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
// Subject Match
layout->StartRow(0, column_view_set_id);
@@ -1118,9 +1113,8 @@ void WifiConfigView::Init(bool show_8021x) {
} else {
layout->AddView(subject_match_textfield_);
}
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
// User certificate
layout->StartRow(0, column_view_set_id);
@@ -1142,9 +1136,8 @@ void WifiConfigView::Init(bool show_8021x) {
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, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
// Identity
layout->StartRow(0, column_view_set_id);
@@ -1164,9 +1157,8 @@ void WifiConfigView::Init(bool show_8021x) {
layout->AddView(identity_textfield_);
}
layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_));
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
}
// Passphrase input
@@ -1226,8 +1218,7 @@ void WifiConfigView::Init(bool show_8021x) {
}
layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL));
if (show_8021x) {
// Anonymous identity
@@ -1249,16 +1240,14 @@ void WifiConfigView::Init(bool show_8021x) {
}
layout->AddView(
new ControlledSettingIndicatorView(identity_anonymous_ui_data_));
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
}
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
// We need a little bit more padding above Checkboxes.
- layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ layout->AddPaddingRow(0, provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
}
// Checkboxes.
@@ -1287,8 +1276,7 @@ void WifiConfigView::Init(bool show_8021x) {
layout->AddView(share_network_checkbox_);
}
layout->AddPaddingRow(
- 0, delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
+ 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL));
// Create an error label.
layout->StartRow(0, column_view_set_id);
« no previous file with comments | « chrome/browser/chromeos/options/vpn_config_view.cc ('k') | chrome/browser/chromeos/options/wimax_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698