| Index: chrome/browser/ui/views/login_view.cc
|
| diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc
|
| index 9e74897cb6a4fb93fa60c19c698915bb944724d0..53dc6b80685184dc93e923bef14c19d18ed70ac4 100644
|
| --- a/chrome/browser/ui/views/login_view.cc
|
| +++ b/chrome/browser/ui/views/login_view.cc
|
| @@ -6,10 +6,11 @@
|
|
|
| #include "components/strings/grit/components_strings.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| +#include "ui/harmony/harmony_layout_delegate.h"
|
| #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/layout/layout_delegate.h"
|
|
|
| static const int kMessageWidth = 320;
|
| static const int kTextfieldStackHorizontalSpacing = 30;
|
| @@ -32,6 +33,8 @@ LoginView::LoginView(const base::string16& authority,
|
| authority_label_(new views::Label(authority)),
|
| message_label_(nullptr),
|
| login_model_(login_model_data ? login_model_data->model : nullptr) {
|
| + ui::HarmonyLayoutDelegate::ApplyToViewIfNeeded(this);
|
| +
|
| password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
|
|
|
| authority_label_->SetMultiLine(true);
|
| @@ -53,13 +56,17 @@ LoginView::LoginView(const base::string16& authority,
|
| // Add the column set for the user name and password fields and labels.
|
| const int labels_column_set_id = 1;
|
| column_set = layout->AddColumnSet(labels_column_set_id);
|
| - column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
|
| - column_set->AddColumn(views::kControlLabelGridAlignment, GridLayout::CENTER,
|
| - 0, GridLayout::USE_PREF, 0, 0);
|
| - column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
|
| + if (GetLayoutDelegate()->UseExtraDialogPadding())
|
| + column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
|
| + column_set->AddColumn(GetLayoutDelegate()->GetControlLabelGridAlignment(),
|
| + GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0);
|
| + column_set->AddPaddingColumn(
|
| + 0, GetLayoutDelegate()->GetLayoutDistance(
|
| + views::LayoutDelegate::RELATED_CONTROL_HORIZONTAL_SPACING));
|
| column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1,
|
| GridLayout::USE_PREF, 0, 0);
|
| - column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
|
| + if (GetLayoutDelegate()->UseExtraDialogPadding())
|
| + column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
|
|
|
| layout->StartRow(0, single_column_view_set_id);
|
| layout->AddView(authority_label_);
|
| @@ -68,24 +75,34 @@ LoginView::LoginView(const base::string16& authority,
|
| message_label_->SetMultiLine(true);
|
| message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
|
| message_label_->SetAllowCharacterBreak(true);
|
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout->AddPaddingRow(
|
| + 0, GetLayoutDelegate()->GetLayoutDistance(
|
| + views::LayoutDelegate::RELATED_CONTROL_VERTICAL_SPACING));
|
| layout->StartRow(0, single_column_view_set_id);
|
| layout->AddView(message_label_);
|
| }
|
|
|
| - layout->AddPaddingRow(0, views::kUnrelatedControlLargeVerticalSpacing);
|
| + layout->AddPaddingRow(
|
| + 0, GetLayoutDelegate()->GetLayoutDistance(
|
| + views::LayoutDelegate::UNRELATED_CONTROL_LARGE_VERTICAL_SPACING));
|
|
|
| layout->StartRow(0, labels_column_set_id);
|
| layout->AddView(username_label_);
|
| layout->AddView(username_field_);
|
|
|
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
|
| + layout->AddPaddingRow(
|
| + 0, GetLayoutDelegate()->GetLayoutDistance(
|
| + views::LayoutDelegate::RELATED_CONTROL_VERTICAL_SPACING));
|
|
|
| layout->StartRow(0, labels_column_set_id);
|
| layout->AddView(password_label_);
|
| layout->AddView(password_field_);
|
|
|
| - layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
|
| + if (GetLayoutDelegate()->UseExtraDialogPadding()) {
|
| + layout->AddPaddingRow(
|
| + 0, GetLayoutDelegate()->GetLayoutDistance(
|
| + views::LayoutDelegate::UNRELATED_CONTROL_VERTICAL_SPACING));
|
| + }
|
|
|
| if (login_model_data) {
|
| login_model_->AddObserverAndDeliverCredentials(this,
|
|
|