Chromium Code Reviews| Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
| diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
| index a324f0a761a3d812f912f62f2b9daedaac416a0e..2d84617fe7a13ca59bfaaf60cfa05ac6028e8d31 100644 |
| --- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
| +++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
| @@ -135,9 +135,6 @@ class PopupHeaderView : public views::View { |
| // The listener for the styled labels in this view. |
| views::StyledLabelListener* styled_label_listener_; |
| - // The label that displays security summary for the current page. |
| - views::Label* summary_label_; |
| - |
| // The label that displays the status of the identity check for this site. |
| // Includes a link to open the Chrome Help Center article about connection |
| // security. |
| @@ -184,59 +181,12 @@ PopupHeaderView::PopupHeaderView( |
| views::ButtonListener* button_listener, |
| views::StyledLabelListener* styled_label_listener) |
| : styled_label_listener_(styled_label_listener), |
| - summary_label_(nullptr), |
| details_label_(nullptr), |
| reset_decisions_label_container_(nullptr), |
| reset_decisions_label_(nullptr) { |
| views::GridLayout* layout = new views::GridLayout(this); |
| SetLayoutManager(layout); |
| - const int label_column = 0; |
|
lgarron
2016/12/14 23:46:23
yaaaaaaaaaaaay good riddance :-D
I've added 64085
|
| - views::ColumnSet* column_set = layout->AddColumnSet(label_column); |
| - column_set->AddPaddingColumn(0, kSectionPaddingHorizontal); |
| - column_set->AddColumn(views::GridLayout::FILL, |
| - views::GridLayout::FILL, |
| - 1, |
| - views::GridLayout::USE_PREF, |
| - 0, |
| - 0); |
| - column_set->AddPaddingColumn(1, 0); |
| - column_set->AddColumn(views::GridLayout::FILL, |
| - views::GridLayout::FILL, |
| - 1, |
| - views::GridLayout::USE_PREF, |
| - 0, |
| - 0); |
| - column_set->AddPaddingColumn(0, kHeaderPaddingForCloseButton); |
| - |
| - // First we add the padding needed for the close button. |
| - // In order to move down the summary, we simulate additional padding by giving |
| - // it an empty border on top later on. |
| - layout->AddPaddingRow(0, kHeaderPaddingForCloseButton); |
| - |
| - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| - |
| - layout->StartRow(0, label_column); |
| - const gfx::FontList& font_list = rb.GetFontListWithDelta(1); |
| - summary_label_ = new views::Label(base::string16(), font_list); |
| - summary_label_->SetMultiLine(true); |
| - summary_label_->SetBorder(views::CreateEmptyBorder( |
| - kHeaderPaddingTop - kHeaderPaddingForCloseButton, 0, 0, 0)); |
| - layout->AddView(summary_label_, 1, 1, views::GridLayout::LEADING, |
| - views::GridLayout::TRAILING); |
| - views::ImageButton* close_button = new views::ImageButton(button_listener); |
| - close_button->set_id(BUTTON_CLOSE); |
| - close_button->SetImage(views::CustomButton::STATE_NORMAL, |
| - rb.GetImageNamed(IDR_CLOSE_2).ToImageSkia()); |
| - close_button->SetImage(views::CustomButton::STATE_HOVERED, |
| - rb.GetImageNamed(IDR_CLOSE_2_H).ToImageSkia()); |
| - close_button->SetImage(views::CustomButton::STATE_PRESSED, |
| - rb.GetImageNamed(IDR_CLOSE_2_P).ToImageSkia()); |
| - layout->AddView(close_button, 1, 1, views::GridLayout::TRAILING, |
| - views::GridLayout::LEADING); |
| - |
| - layout->AddPaddingRow(0, kHeaderLabelSpacing); |
| - |
| const int label_column_status = 1; |
| views::ColumnSet* column_set_status = |
| layout->AddColumnSet(label_column_status); |
| @@ -266,10 +216,6 @@ PopupHeaderView::PopupHeaderView( |
| PopupHeaderView::~PopupHeaderView() {} |
| -void PopupHeaderView::SetSummary(const base::string16& summary_text) { |
| - summary_label_->SetText(summary_text); |
| -} |
| - |
| void PopupHeaderView::SetDetails(const base::string16& details_text) { |
| std::vector<base::string16> subst; |
| subst.push_back(details_text); |
| @@ -486,6 +432,9 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView( |
| // Each section handles its own padding. |
| set_margins(gfx::Insets(0, 0, kPopupMarginBottom, 0)); |
| + set_title_margins(gfx::Insets(kHeaderPaddingTop, kSectionPaddingHorizontal, |
| + kHeaderLabelSpacing, |
| + kHeaderPaddingForCloseButton)); |
| views::BubbleDialogDelegateView::CreateBubble(this); |
| @@ -517,6 +466,14 @@ void WebsiteSettingsPopupView::OnChosenObjectDeleted( |
| presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object); |
| } |
| +base::string16 WebsiteSettingsPopupView::GetWindowTitle() const { |
| + return summary_text_; |
| +} |
| + |
| +bool WebsiteSettingsPopupView::ShouldShowCloseButton() const { |
| + return true; |
| +} |
| + |
| void WebsiteSettingsPopupView::OnWidgetDestroying(views::Widget* widget) { |
| g_shown_popup_type = POPUP_NONE; |
| presenter_->OnUIClosing(); |
| @@ -526,6 +483,10 @@ int WebsiteSettingsPopupView::GetDialogButtons() const { |
| return ui::DIALOG_BUTTON_NONE; |
| } |
| +const gfx::FontList& WebsiteSettingsPopupView::GetTitleFontList() const { |
|
lgarron
2016/12/14 23:46:23
It seems we're implementing this to make the font
tapted
2017/01/04 00:36:49
Done. Added a constant, with a comment. (we actual
|
| + return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(1); |
| +} |
| + |
| void WebsiteSettingsPopupView::ButtonPressed(views::Button* button, |
| const ui::Event& event) { |
| DCHECK_EQ(BUTTON_CLOSE, button->id()); |
| @@ -702,7 +663,8 @@ void WebsiteSettingsPopupView::SetIdentityInfo( |
| std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description = |
| identity_info.GetSecurityDescription(); |
| - header_->SetSummary(security_description->summary); |
| + summary_text_ = security_description->summary; |
| + GetWidget()->UpdateWindowTitle(); |
| if (identity_info.certificate) { |
| certificate_ = identity_info.certificate; |