Chromium Code Reviews| Index: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| index 35a937686d01b8869a1014aec4cc6d9aa22340c9..0b712ccba7a58a49b33dd7fe40ca146f763327ac 100644 |
| --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc |
| @@ -39,7 +39,6 @@ |
| #include "ui/views/controls/styled_label_listener.h" |
| #include "ui/views/layout/fill_layout.h" |
| #include "ui/views/layout/grid_layout.h" |
| -#include "ui/views/layout/layout_constants.h" |
| #include "ui/views/widget/widget.h" |
| #if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) |
| @@ -89,6 +88,8 @@ enum TextRowType { ROW_SINGLE, ROW_MULTILINE }; |
| void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) { |
| views::ColumnSet* column_set = layout->AddColumnSet(type); |
| int full_width = ManagePasswordsBubbleView::kDesiredBubbleWidth; |
| + const int button_divider = ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + views::DISTANCE_RELATED_BUTTON_HORIZONTAL); |
| switch (type) { |
| case SINGLE_VIEW_COLUMN_SET: |
| column_set->AddColumn(views::GridLayout::FILL, |
| @@ -105,7 +106,7 @@ void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) { |
| views::GridLayout::USE_PREF, |
| 0, |
| 0); |
| - column_set->AddPaddingColumn(0, views::kRelatedButtonHSpacing); |
| + column_set->AddPaddingColumn(0, button_divider); |
| column_set->AddColumn(views::GridLayout::TRAILING, |
| views::GridLayout::CENTER, |
| 0, |
| @@ -120,7 +121,7 @@ void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) { |
| views::GridLayout::USE_PREF, |
| 0, |
| 0); |
| - column_set->AddPaddingColumn(0, views::kRelatedButtonHSpacing); |
| + column_set->AddPaddingColumn(0, button_divider); |
| column_set->AddColumn(views::GridLayout::TRAILING, |
| views::GridLayout::CENTER, |
| 0, |
| @@ -143,14 +144,14 @@ void BuildColumnSet(views::GridLayout* layout, ColumnSetType type) { |
| views::GridLayout::USE_PREF, |
| 0, |
| 0); |
| - column_set->AddPaddingColumn(0, views::kRelatedButtonHSpacing); |
| + column_set->AddPaddingColumn(0, button_divider); |
| column_set->AddColumn(views::GridLayout::TRAILING, |
| views::GridLayout::CENTER, |
| 0, |
| views::GridLayout::USE_PREF, |
| 0, |
| 0); |
| - column_set->AddPaddingColumn(0, views::kRelatedButtonHSpacing); |
| + column_set->AddPaddingColumn(0, button_divider); |
| column_set->AddColumn(views::GridLayout::TRAILING, |
| views::GridLayout::CENTER, |
| 0, |
| @@ -179,13 +180,13 @@ void AddTitleRowWithLink(views::GridLayout* layout, |
| views::StyledLabel* title_label = |
| new views::StyledLabel(model->title(), listener); |
| - title_label->SetBaseFontList( |
| - ui::ResourceBundle::GetSharedInstance().GetFontList( |
| - ui::ResourceBundle::MediumFont)); |
| + title_label->SetBaseFontList(views::style::GetFont( |
| + views::style::CONTEXT_DIALOG_TITLE, views::style::STYLE_PRIMARY)); |
| title_label->AddStyleRange(model->title_brand_link_range(), GetLinkStyle()); |
| layout->StartRow(0, SINGLE_VIEW_COLUMN_SET); |
| layout->AddView(title_label); |
| - layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + DISTANCE_UNRELATED_CONTROL_VERTICAL)); |
|
tapted
2017/05/10 05:30:12
INSETS_BUBBLE_CONTENTS.top()?
Patti Lor
2017/05/11 06:59:18
Done. I also went ahead and changed other places w
|
| } |
| } // namespace |
| @@ -338,7 +339,8 @@ ManagePasswordsBubbleView::PendingView::PendingView( |
| if (item) { |
| layout->StartRow(0, SINGLE_VIEW_COLUMN_SET); |
| layout->AddView(item); |
| - layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + DISTANCE_UNRELATED_CONTROL_VERTICAL)); |
|
tapted
2017/05/10 05:30:12
INSETS_BUBBLE_CONTENTS.bottom()?
Patti Lor
2017/05/11 06:59:19
Done, + button insets top below.
|
| } |
| // Button row. |
| @@ -410,30 +412,27 @@ ManagePasswordsBubbleView::ManageView::ManageView( |
| ManagePasswordsBubbleView* parent) |
| : parent_(parent) { |
| views::GridLayout* layout = new views::GridLayout(this); |
| + const int vertical_padding = ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + DISTANCE_UNRELATED_CONTROL_VERTICAL); |
| layout->set_minimum_size(gfx::Size(kDesiredBubbleWidth, 0)); |
| SetLayoutManager(layout); |
| + BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET); |
| + layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0, vertical_padding); |
|
tapted
2017/05/10 05:30:12
INSETS_BUBBLE_CONTENTS.top()?
Patti Lor
2017/05/11 06:59:19
Deleted this, because this is also always beneath
|
| // If we have a list of passwords to store for the current site, display |
| // them to the user for management. Otherwise, render a "No passwords for |
| // this site" message. |
| - BuildColumnSet(layout, SINGLE_VIEW_COLUMN_SET); |
| if (!parent_->model()->local_credentials().empty()) { |
| ManagePasswordItemsView* item = new ManagePasswordItemsView( |
| parent_->model(), &parent_->model()->local_credentials()); |
| - layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0, |
| - views::kUnrelatedControlVerticalSpacing); |
| layout->AddView(item); |
| } else { |
| views::Label* empty_label = new views::Label( |
| l10n_util::GetStringUTF16(IDS_MANAGE_PASSWORDS_NO_PASSWORDS)); |
|
tapted
2017/05/10 05:30:12
DEPRECATED_SMALL
Patti Lor
2017/05/11 06:59:19
Done.
|
| empty_label->SetMultiLine(true); |
| empty_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| - empty_label->SetFontList( |
| - ui::ResourceBundle::GetSharedInstance().GetFontList( |
| - ui::ResourceBundle::SmallFont)); |
| - |
| - layout->StartRowWithPadding(0, SINGLE_VIEW_COLUMN_SET, 0, |
| - views::kUnrelatedControlVerticalSpacing); |
| + empty_label->SetFontList(views::style::GetFont( |
| + views::style::CONTEXT_LABEL, views::style::STYLE_PRIMARY)); |
| layout->AddView(empty_label); |
| } |
| @@ -447,8 +446,7 @@ ManagePasswordsBubbleView::ManageView::ManageView( |
| this, l10n_util::GetStringUTF16(IDS_DONE)); |
| BuildColumnSet(layout, LINK_BUTTON_COLUMN_SET); |
| - layout->StartRowWithPadding(0, LINK_BUTTON_COLUMN_SET, 0, |
| - views::kUnrelatedControlVerticalSpacing); |
| + layout->StartRowWithPadding(0, LINK_BUTTON_COLUMN_SET, 0, vertical_padding); |
|
tapted
2017/05/10 05:30:12
INSETS_BUBBLE_CONTENTS.bottom()?
Patti Lor
2017/05/11 06:59:19
Done, + button insets top
|
| layout->AddView(manage_link_); |
| layout->AddView(done_button_); |
| @@ -509,9 +507,8 @@ ManagePasswordsBubbleView::SaveConfirmationView::SaveConfirmationView( |
| views::StyledLabel* confirmation = |
| new views::StyledLabel(parent_->model()->save_confirmation_text(), this); |
| - confirmation->SetBaseFontList( |
| - ui::ResourceBundle::GetSharedInstance().GetFontList( |
| - ui::ResourceBundle::SmallFont)); |
| + confirmation->SetBaseFontList(views::style::GetFont( |
| + views::style::CONTEXT_LABEL, views::style::STYLE_PRIMARY)); |
|
tapted
2017/05/10 05:30:12
DEPRECATED_SMALL
Patti Lor
2017/05/11 06:59:19
Done.
|
| confirmation->AddStyleRange( |
| parent_->model()->save_confirmation_link_range(), GetLinkStyle()); |
| @@ -523,8 +520,9 @@ ManagePasswordsBubbleView::SaveConfirmationView::SaveConfirmationView( |
| this, l10n_util::GetStringUTF16(IDS_OK)); |
| BuildColumnSet(layout, SINGLE_BUTTON_COLUMN_SET); |
| - layout->StartRowWithPadding( |
| - 0, SINGLE_BUTTON_COLUMN_SET, 0, views::kRelatedControlVerticalSpacing); |
| + layout->StartRowWithPadding(0, SINGLE_BUTTON_COLUMN_SET, 0, |
| + ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + views::DISTANCE_RELATED_CONTROL_VERTICAL)); |
|
Patti Lor
2017/05/11 06:59:18
Changed this to bubble contents bottom + button ro
|
| layout->AddView(ok_button_); |
| parent_->set_initially_focused_view(ok_button_); |
| @@ -674,7 +672,8 @@ ManagePasswordsBubbleView::UpdatePendingView::UpdatePendingView( |
| // Button row. |
| BuildColumnSet(layout, DOUBLE_BUTTON_COLUMN_SET); |
| layout->StartRowWithPadding(0, DOUBLE_BUTTON_COLUMN_SET, 0, |
| - views::kUnrelatedControlVerticalSpacing); |
| + ChromeLayoutProvider::Get()->GetDistanceMetric( |
| + DISTANCE_UNRELATED_CONTROL_VERTICAL)); |
|
tapted
2017/05/10 05:30:12
INSETS_BUBBLE_CONTENTS.bottom()?
Patti Lor
2017/05/11 06:59:19
Done + button row top.
|
| layout->AddView(update_button_); |
| layout->AddView(nope_button_); |