OLD | NEW |
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 "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/certificate_viewer.h" | 9 #include "chrome/browser/certificate_viewer.h" |
10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 kSpacing, kSpacing)); | 229 kSpacing, kSpacing)); |
230 views::ImageView* icon_view = new views::ImageView(); | 230 views::ImageView* icon_view = new views::ImageView(); |
231 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 231 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
232 icon_view->SetImage(rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_26)); | 232 icon_view->SetImage(rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_26)); |
233 AddChildView(icon_view); | 233 AddChildView(icon_view); |
234 | 234 |
235 views::Label* label = | 235 views::Label* label = |
236 new views::Label(l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE)); | 236 new views::Label(l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE)); |
237 label->SetMultiLine(true); | 237 label->SetMultiLine(true); |
238 label->SetAllowCharacterBreak(true); | 238 label->SetAllowCharacterBreak(true); |
239 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 239 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
240 AddChildView(label); | 240 AddChildView(label); |
241 | 241 |
242 views::BubbleDelegateView::CreateBubble(this); | 242 views::BubbleDelegateView::CreateBubble(this); |
243 Show(); | 243 Show(); |
244 SizeToContents(); | 244 SizeToContents(); |
245 } | 245 } |
246 | 246 |
247 InternalPageInfoPopupView::~InternalPageInfoPopupView() { | 247 InternalPageInfoPopupView::~InternalPageInfoPopupView() { |
248 } | 248 } |
249 | 249 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 views::GridLayout::LEADING, | 713 views::GridLayout::LEADING, |
714 1, | 714 1, |
715 views::GridLayout::USE_PREF, | 715 views::GridLayout::USE_PREF, |
716 0, | 716 0, |
717 0); | 717 0); |
718 if (!headline.empty()) { | 718 if (!headline.empty()) { |
719 views::Label* headline_label = new views::Label(headline); | 719 views::Label* headline_label = new views::Label(headline); |
720 headline_label->SetFont( | 720 headline_label->SetFont( |
721 headline_label->font().DeriveFont(0, gfx::Font::BOLD)); | 721 headline_label->font().DeriveFont(0, gfx::Font::BOLD)); |
722 headline_label->SetMultiLine(true); | 722 headline_label->SetMultiLine(true); |
723 headline_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 723 headline_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
724 // Allow linebreaking in the middle of words if necessary, so that extremely | 724 // Allow linebreaking in the middle of words if necessary, so that extremely |
725 // long hostnames (longer than one line) will still be completely shown. | 725 // long hostnames (longer than one line) will still be completely shown. |
726 headline_label->SetAllowCharacterBreak(true); | 726 headline_label->SetAllowCharacterBreak(true); |
727 content_layout->StartRow(1, 0); | 727 content_layout->StartRow(1, 0); |
728 content_layout->AddView(headline_label); | 728 content_layout->AddView(headline_label); |
729 } | 729 } |
730 | 730 |
731 views::Label* description_label = new views::Label(text); | 731 views::Label* description_label = new views::Label(text); |
732 description_label->SetMultiLine(true); | 732 description_label->SetMultiLine(true); |
733 description_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 733 description_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
734 description_label->SetAllowCharacterBreak(true); | 734 description_label->SetAllowCharacterBreak(true); |
735 content_layout->StartRow(1, 0); | 735 content_layout->StartRow(1, 0); |
736 content_layout->AddView(description_label); | 736 content_layout->AddView(description_label); |
737 | 737 |
738 if (link) { | 738 if (link) { |
739 content_layout->StartRow(1, 0); | 739 content_layout->StartRow(1, 0); |
740 content_layout->AddView(link); | 740 content_layout->AddView(link); |
741 } | 741 } |
742 | 742 |
743 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, | 743 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, |
744 views::GridLayout::LEADING); | 744 views::GridLayout::LEADING); |
745 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); | 745 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); |
746 } | 746 } |
OLD | NEW |