Commit ed18fe2b authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: normalize collected cookies infobar padding

This change replaces the infobar's custom padding with the
new INSETS_DIALOG padding constant. This causes the infobar's icon
to be aligned with the other controls on the left margin.

Bug: 610428
Change-Id: Idb4c2faaa16004951eaf9988cd768b7dcc359167
Reviewed-on: https://chromium-review.googlesource.com/758558Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516067}
parent 2383d320
...@@ -55,10 +55,6 @@ ...@@ -55,10 +55,6 @@
namespace { namespace {
// Spacing between the infobar frame and its contents.
const int kInfobarVerticalPadding = 3;
const int kInfobarHorizontalPadding = 8;
// Dimensions of the tree views. // Dimensions of the tree views.
const int kTreeViewWidth = 400; const int kTreeViewWidth = 400;
const int kTreeViewHeight = 125; const int kTreeViewHeight = 125;
...@@ -186,11 +182,22 @@ class InfobarView : public views::View { ...@@ -186,11 +182,22 @@ class InfobarView : public views::View {
// Initialize contents and layout. // Initialize contents and layout.
void Init() { void Init() {
AddChildView(content_); AddChildView(content_);
content_->SetLayoutManager(new views::BoxLayout( // The containing dialog content view has no margins so that its
views::BoxLayout::kHorizontal, // TabbedPane can span the full width of the dialog, but because of
gfx::Insets(kInfobarVerticalPadding, kInfobarHorizontalPadding), // that, InfobarView needs to impose its own horizontal margin.
ChromeLayoutProvider::Get()->GetDistanceMetric( gfx::Insets dialog_insets =
DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL))); ChromeLayoutProvider::Get()->GetInsetsMetric(views::INSETS_DIALOG);
// No top inset is needed because the control above the infobar imposes one,
// but the button bar below the infobar has no margin, so a small bottom
// inset is needed.
gfx::Insets layout_insets(0, dialog_insets.left(),
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_CONTROL_VERTICAL_SMALL),
dialog_insets.right());
content_->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kHorizontal, layout_insets,
ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL)));
content_->AddChildView(info_image_); content_->AddChildView(info_image_);
content_->AddChildView(label_); content_->AddChildView(label_);
UpdateVisibility(false, CONTENT_SETTING_BLOCK, base::string16()); UpdateVisibility(false, CONTENT_SETTING_BLOCK, base::string16());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment