Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h " 5 #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 // In order to move down the summary, we simulate additional padding by giving 216 // In order to move down the summary, we simulate additional padding by giving
217 // it an empty border on top later on. 217 // it an empty border on top later on.
218 layout->AddPaddingRow(0, kHeaderPaddingForCloseButton); 218 layout->AddPaddingRow(0, kHeaderPaddingForCloseButton);
219 219
220 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 220 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
221 221
222 layout->StartRow(0, label_column); 222 layout->StartRow(0, label_column);
223 const gfx::FontList& font_list = rb.GetFontListWithDelta(1); 223 const gfx::FontList& font_list = rb.GetFontListWithDelta(1);
224 summary_label_ = new views::Label(base::string16(), font_list); 224 summary_label_ = new views::Label(base::string16(), font_list);
225 summary_label_->SetMultiLine(true); 225 summary_label_->SetMultiLine(true);
226 summary_label_->SetBorder(views::Border::CreateEmptyBorder( 226 summary_label_->SetBorder(views::CreateEmptyBorder(
227 kHeaderPaddingTop - kHeaderPaddingForCloseButton, 0, 0, 0)); 227 kHeaderPaddingTop - kHeaderPaddingForCloseButton, 0, 0, 0));
228 layout->AddView(summary_label_, 1, 1, views::GridLayout::LEADING, 228 layout->AddView(summary_label_, 1, 1, views::GridLayout::LEADING,
229 views::GridLayout::TRAILING); 229 views::GridLayout::TRAILING);
230 views::ImageButton* close_button = new views::ImageButton(button_listener); 230 views::ImageButton* close_button = new views::ImageButton(button_listener);
231 close_button->set_id(BUTTON_CLOSE); 231 close_button->set_id(BUTTON_CLOSE);
232 close_button->SetImage(views::CustomButton::STATE_NORMAL, 232 close_button->SetImage(views::CustomButton::STATE_NORMAL,
233 rb.GetImageNamed(IDR_CLOSE_2).ToImageSkia()); 233 rb.GetImageNamed(IDR_CLOSE_2).ToImageSkia());
234 close_button->SetImage(views::CustomButton::STATE_HOVERED, 234 close_button->SetImage(views::CustomButton::STATE_HOVERED,
235 rb.GetImageNamed(IDR_CLOSE_2_H).ToImageSkia()); 235 rb.GetImageNamed(IDR_CLOSE_2_H).ToImageSkia());
236 close_button->SetImage(views::CustomButton::STATE_PRESSED, 236 close_button->SetImage(views::CustomButton::STATE_PRESSED,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE; 323 link_style.font_style |= gfx::Font::FontStyle::UNDERLINE;
324 link_style.disable_line_wrapping = false; 324 link_style.disable_line_wrapping = false;
325 325
326 reset_decisions_label_->AddStyleRange(link_range, link_style); 326 reset_decisions_label_->AddStyleRange(link_range, link_style);
327 // Fit the styled label to occupy available width. 327 // Fit the styled label to occupy available width.
328 reset_decisions_label_->SizeToFit(0); 328 reset_decisions_label_->SizeToFit(0);
329 reset_decisions_label_container_->AddChildView(reset_decisions_label_); 329 reset_decisions_label_container_->AddChildView(reset_decisions_label_);
330 330
331 // Now that it contains a label, the container needs padding at the top. 331 // Now that it contains a label, the container needs padding at the top.
332 reset_decisions_label_container_->SetBorder( 332 reset_decisions_label_container_->SetBorder(
333 views::Border::CreateEmptyBorder(8, 0, 0, 0)); 333 views::CreateEmptyBorder(8, 0, 0, 0));
334 334
335 InvalidateLayout(); 335 InvalidateLayout();
336 } 336 }
337 337
338 //////////////////////////////////////////////////////////////////////////////// 338 ////////////////////////////////////////////////////////////////////////////////
339 // InternalPageInfoPopupView 339 // InternalPageInfoPopupView
340 //////////////////////////////////////////////////////////////////////////////// 340 ////////////////////////////////////////////////////////////////////////////////
341 341
342 InternalPageInfoPopupView::InternalPageInfoPopupView( 342 InternalPageInfoPopupView::InternalPageInfoPopupView(
343 views::View* anchor_view, 343 views::View* anchor_view,
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 } 802 }
803 break; 803 break;
804 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: 804 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
805 presenter_->OnRevokeSSLErrorBypassButtonPressed(); 805 presenter_->OnRevokeSSLErrorBypassButtonPressed();
806 GetWidget()->Close(); 806 GetWidget()->Close();
807 break; 807 break;
808 default: 808 default:
809 NOTREACHED(); 809 NOTREACHED();
810 } 810 }
811 } 811 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc ('k') | ui/app_list/views/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698