Index: chrome/browser/ui/views/website_settings/permission_selector_row.cc |
diff --git a/chrome/browser/ui/views/website_settings/permission_selector_row.cc b/chrome/browser/ui/views/website_settings/permission_selector_row.cc |
index 780e1f2c28b2ce3778ce720ab000e8d0dbe14317..4c7b194e6e72932b225a8da0de447bf08dfbf332 100644 |
--- a/chrome/browser/ui/views/website_settings/permission_selector_row.cc |
+++ b/chrome/browser/ui/views/website_settings/permission_selector_row.cc |
@@ -26,6 +26,11 @@ |
#include "ui/views/view.h" |
#include "ui/views/widget/widget.h" |
+namespace { |
+// Minimum distance between the label and its corresponding menu. |
+const int kMinSeparationBetweenLabelAndMenu = 16; |
+} |
+ |
namespace internal { |
// The |PermissionMenuButton| provides a menu for selecting a setting a |
@@ -234,25 +239,15 @@ PermissionSelectorRow::PermissionSelectorRow( |
SetLayoutManager(layout); |
const int column_set_id = 0; |
views::ColumnSet* column_set = layout->AddColumnSet(column_set_id); |
- column_set->AddColumn(views::GridLayout::FILL, |
- views::GridLayout::FILL, |
- 1, |
- views::GridLayout::FIXED, |
- kPermissionIconColumnWidth, |
+ column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 0, |
+ views::GridLayout::FIXED, kPermissionIconColumnWidth, |
0); |
column_set->AddPaddingColumn(0, kPermissionIconMarginLeft); |
- column_set->AddColumn(views::GridLayout::FILL, |
- views::GridLayout::FILL, |
- 1, |
- views::GridLayout::USE_PREF, |
- 0, |
- 0); |
- column_set->AddColumn(views::GridLayout::FILL, |
- views::GridLayout::FILL, |
- 1, |
- views::GridLayout::USE_PREF, |
- 0, |
- 0); |
+ column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 0, |
+ views::GridLayout::USE_PREF, 0, 0); |
+ column_set->AddPaddingColumn(1, kMinSeparationBetweenLabelAndMenu); |
+ column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 0, |
+ views::GridLayout::USE_PREF, 0, 0); |
layout->StartRow(1, column_set_id); |
// Create the permission icon. |
@@ -265,9 +260,8 @@ PermissionSelectorRow::PermissionSelectorRow( |
views::GridLayout::CENTER, |
views::GridLayout::CENTER); |
// Create the label that displays the permission type. |
- views::Label* label = new views::Label(l10n_util::GetStringFUTF16( |
- IDS_WEBSITE_SETTINGS_PERMISSION_TYPE, |
- WebsiteSettingsUI::PermissionTypeToUIString(permission.type))); |
+ views::Label* label = new views::Label( |
+ WebsiteSettingsUI::PermissionTypeToUIString(permission.type)); |
layout->AddView(label, |
1, |
1, |
@@ -368,7 +362,7 @@ void PermissionSelectorRow::PermissionChanged( |
menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString( |
permission.type, permission.setting, permission.default_setting, |
content_settings::SETTING_SOURCE_USER)); |
- menu_button_->SizeToPreferredSize(); |
+ ChildPreferredSizeChanged(menu_button_); |
msw
2016/10/08 00:21:57
Can this just continue calling |menu_button_->Size
lgarron
2016/10/08 03:50:04
Yes, it can! That does seem to work.
|
} else if (combobox_) { |
bool use_default = permission.setting == CONTENT_SETTING_DEFAULT; |
combobox_->UpdateSelectedIndex(use_default); |