| Index: chrome/browser/ui/views/collected_cookies_views.cc
|
| diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc
|
| index 81e8017673d07a3635aea286cebb9ef7d5c18fbf..ee8a34d407c188edba69bcab9ff6ad3d60997d81 100644
|
| --- a/chrome/browser/ui/views/collected_cookies_views.cc
|
| +++ b/chrome/browser/ui/views/collected_cookies_views.cc
|
| @@ -21,7 +21,7 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
|
| #include "chrome/browser/ui/views/cookie_info_view.h"
|
| -#include "chrome/browser/ui/views/harmony/layout_delegate.h"
|
| +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/grit/generated_resources.h"
|
| #include "chrome/grit/locale_settings.h"
|
| @@ -71,11 +71,11 @@ const int kCookieInfoBottomPadding = 4;
|
| // Starts a new row with the added ColumnSet.
|
| void StartNewButtonColumnSet(views::GridLayout* layout,
|
| const int column_layout_id) {
|
| - LayoutDelegate* layout_delegate = LayoutDelegate::Get();
|
| - const int button_padding = layout_delegate->GetMetric(
|
| - LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING);
|
| - const int button_size_limit = layout_delegate->GetMetric(
|
| - LayoutDelegate::Metric::BUTTON_MAX_LINKABLE_WIDTH);
|
| + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
|
| + const int button_padding =
|
| + provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL);
|
| + const int button_size_limit =
|
| + provider->GetDistanceMetric(DISTANCE_BUTTON_MAX_LINKABLE_WIDTH);
|
|
|
| views::ColumnSet* column_set = layout->AddColumnSet(column_layout_id);
|
| column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0,
|
| @@ -291,8 +291,8 @@ gfx::Size CollectedCookiesViews::GetMinimumSize() const {
|
| }
|
|
|
| gfx::Size CollectedCookiesViews::GetPreferredSize() const {
|
| - int preferred = LayoutDelegate::Get()->GetDialogPreferredWidth(
|
| - LayoutDelegate::DialogWidth::MEDIUM);
|
| + int preferred =
|
| + ChromeLayoutProvider::Get()->GetDialogPreferredWidth(DialogWidth::MEDIUM);
|
| return gfx::Size(preferred ? preferred : View::GetPreferredSize().width(),
|
| View::GetPreferredSize().height());
|
| }
|
| @@ -316,7 +316,8 @@ void CollectedCookiesViews::Init() {
|
| using views::GridLayout;
|
|
|
| GridLayout* layout = new GridLayout(this);
|
| - if (LayoutDelegate::Get()->UseExtraDialogPadding())
|
| + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
|
| + if (provider->UseExtraDialogPadding())
|
| layout->SetInsets(gfx::Insets(kTabbedPaneTopPadding, 0, 0, 0));
|
| SetLayoutManager(layout);
|
|
|
| @@ -338,17 +339,15 @@ void CollectedCookiesViews::Init() {
|
| tabbed_pane->AddTab(label_blocked, CreateBlockedPane());
|
| tabbed_pane->SelectTabAt(0);
|
| tabbed_pane->set_listener(this);
|
| - if (LayoutDelegate::Get()->UseExtraDialogPadding()) {
|
| - layout->AddPaddingRow(
|
| - 0,
|
| - LayoutDelegate::Get()->GetMetric(
|
| - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING));
|
| + if (ChromeLayoutProvider::Get()->UseExtraDialogPadding()) {
|
| + layout->AddPaddingRow(0, provider->GetDistanceMetric(
|
| + views::DISTANCE_RELATED_CONTROL_VERTICAL));
|
| }
|
|
|
| layout->StartRow(0, single_column_layout_id);
|
| cookie_info_view_ = new CookieInfoView();
|
| layout->AddView(cookie_info_view_);
|
| - if (LayoutDelegate::Get()->UseExtraDialogPadding())
|
| + if (provider->UseExtraDialogPadding())
|
| layout->AddPaddingRow(0, kCookieInfoBottomPadding);
|
|
|
| layout->StartRow(0, single_column_layout_id);
|
| @@ -389,6 +388,9 @@ views::View* CollectedCookiesViews::CreateAllowedPane() {
|
|
|
| views::View* pane = new views::View();
|
| GridLayout* layout = GridLayout::CreatePanel(pane);
|
| + int unrelated_vertical_distance =
|
| + ChromeLayoutProvider::Get()->GetDistanceMetric(
|
| + DISTANCE_UNRELATED_CONTROL_VERTICAL);
|
|
|
| const int single_column_layout_id = 0;
|
| views::ColumnSet* column_set = layout->AddColumnSet(single_column_layout_id);
|
| @@ -397,18 +399,13 @@ views::View* CollectedCookiesViews::CreateAllowedPane() {
|
|
|
| layout->StartRow(0, single_column_layout_id);
|
| layout->AddView(allowed_label_);
|
| - layout->AddPaddingRow(
|
| - 0,
|
| - LayoutDelegate::Get()->GetMetric(
|
| - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING));
|
| + layout->AddPaddingRow(0, unrelated_vertical_distance);
|
|
|
| layout->StartRow(1, single_column_layout_id);
|
| layout->AddView(CreateScrollView(allowed_cookies_tree_), 1, 1,
|
| GridLayout::FILL, GridLayout::FILL, kTreeViewWidth,
|
| kTreeViewHeight);
|
| - layout->AddPaddingRow(
|
| - 0, LayoutDelegate::Get()->GetMetric(
|
| - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING));
|
| + layout->AddPaddingRow(0, unrelated_vertical_distance);
|
|
|
| StartNewButtonColumnSet(layout, single_column_layout_id + 1);
|
| layout->AddView(block_allowed_button_);
|
| @@ -455,6 +452,9 @@ views::View* CollectedCookiesViews::CreateBlockedPane() {
|
|
|
| views::View* pane = new views::View();
|
| GridLayout* layout = GridLayout::CreatePanel(pane);
|
| + int unrelated_vertical_distance =
|
| + ChromeLayoutProvider::Get()->GetDistanceMetric(
|
| + DISTANCE_UNRELATED_CONTROL_VERTICAL);
|
|
|
| const int single_column_layout_id = 0;
|
| views::ColumnSet* column_set = layout->AddColumnSet(single_column_layout_id);
|
| @@ -463,18 +463,13 @@ views::View* CollectedCookiesViews::CreateBlockedPane() {
|
|
|
| layout->StartRow(0, single_column_layout_id);
|
| layout->AddView(blocked_label_, 1, 1, GridLayout::FILL, GridLayout::FILL);
|
| - layout->AddPaddingRow(
|
| - 0,
|
| - LayoutDelegate::Get()->GetMetric(
|
| - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING));
|
| + layout->AddPaddingRow(0, unrelated_vertical_distance);
|
|
|
| layout->StartRow(1, single_column_layout_id);
|
| layout->AddView(
|
| CreateScrollView(blocked_cookies_tree_), 1, 1,
|
| GridLayout::FILL, GridLayout::FILL, kTreeViewWidth, kTreeViewHeight);
|
| - layout->AddPaddingRow(
|
| - 0, LayoutDelegate::Get()->GetMetric(
|
| - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING));
|
| + layout->AddPaddingRow(0, unrelated_vertical_distance);
|
|
|
| StartNewButtonColumnSet(layout, single_column_layout_id + 1);
|
| layout->AddView(allow_blocked_button_);
|
|
|