Chromium Code Reviews| Index: chrome/browser/ui/views/content_setting_bubble_contents.cc |
| diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| index 423bcc2f675ce27ee0302596ce4ca266cd6d58d1..7aafa91da9b887e46fa2e61d3346b008788ebc10 100644 |
| --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc |
| @@ -18,6 +18,7 @@ |
| #include "chrome/browser/plugins/plugin_metadata.h" |
| #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| #include "chrome/browser/ui/layout_constants.h" |
| +#include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "components/content_settings/core/browser/host_content_settings_map.h" |
| #include "components/strings/grit/components_strings.h" |
| @@ -200,12 +201,15 @@ void ContentSettingBubbleContents::Init() { |
| GridLayout* layout = new views::GridLayout(this); |
| SetLayoutManager(layout); |
| + const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); |
| const int kSingleColumnSetId = 0; |
| views::ColumnSet* column_set = layout->AddColumnSet(kSingleColumnSetId); |
| column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, |
| GridLayout::USE_PREF, 0, 0); |
| - column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing); |
| + column_set->AddPaddingColumn(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_HORIZONTAL_SPACING)); |
|
Peter Kasting
2016/12/12 22:24:16
Seems unfortunate that we have to write something
kylix_rd
2016/12/13 14:21:23
Good point. I was slavishly following the examples
|
| column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, |
| GridLayout::USE_PREF, 0, 0); |
| @@ -224,7 +228,9 @@ void ContentSettingBubbleContents::Init() { |
| if (!bubble_content.message.empty()) { |
| views::Label* message_label = new views::Label(bubble_content.message); |
| - layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + UNRELATED_CONTROL_VERTICAL_SPACING)); |
| message_label->SetMultiLine(true); |
| message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| layout->StartRow(0, kSingleColumnSetId); |
| @@ -249,7 +255,9 @@ void ContentSettingBubbleContents::Init() { |
| item_list_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 0, |
| GridLayout::USE_PREF, 0, 0); |
| item_list_column_set->AddPaddingColumn( |
| - 0, views::kRelatedControlHorizontalSpacing); |
| + 0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_HORIZONTAL_SPACING)); |
| item_list_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, |
| GridLayout::USE_PREF, 0, 0); |
| @@ -257,7 +265,9 @@ void ContentSettingBubbleContents::Init() { |
| for (const ContentSettingBubbleModel::ListItem& list_item : |
| bubble_content.list_items) { |
| if (!bubble_content_empty) |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| layout->StartRow(0, kItemListColumnSetId); |
| if (list_item.has_link) { |
| views::Link* link = new views::Link(base::UTF8ToUTF16(list_item.title)); |
| @@ -289,7 +299,9 @@ void ContentSettingBubbleContents::Init() { |
| bubble_content.radio_group; |
| if (!radio_group.radio_items.empty()) { |
| if (!bubble_content_empty) |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| for (ContentSettingBubbleModel::RadioItems::const_iterator i( |
| radio_group.radio_items.begin()); |
| i != radio_group.radio_items.end(); ++i) { |
| @@ -325,7 +337,9 @@ void ContentSettingBubbleContents::Init() { |
| bubble_content.media_menus.begin()); |
| i != bubble_content.media_menus.end(); ++i) { |
| if (!bubble_content_empty) |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| layout->StartRow(0, kMediaMenuColumnSetId); |
| views::Label* label = |
| @@ -376,18 +390,24 @@ void ContentSettingBubbleContents::Init() { |
| custom_link_->SetEnabled(bubble_content.custom_link_enabled); |
| custom_link_->set_listener(this); |
| if (!bubble_content_empty) |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| layout->StartRow(0, kSingleColumnSetId); |
| layout->AddView(custom_link_); |
| bubble_content_empty = false; |
| } |
| if (!bubble_content_empty) { |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| layout->StartRow(0, kSingleColumnSetId); |
| layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 1, 1, |
| GridLayout::FILL, GridLayout::FILL); |
| - layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| + layout->AddPaddingRow(0, layout_delegate->GetLayoutDistance( |
| + LayoutDelegate::LayoutDistanceType:: |
| + RELATED_CONTROL_VERTICAL_SPACING)); |
| } |
| } |