| 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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 147 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
| 148 | 148 |
| 149 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoPopupView); | 149 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoPopupView); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 //////////////////////////////////////////////////////////////////////////////// | 152 //////////////////////////////////////////////////////////////////////////////// |
| 153 // Popup Header | 153 // Popup Header |
| 154 //////////////////////////////////////////////////////////////////////////////// | 154 //////////////////////////////////////////////////////////////////////////////// |
| 155 | 155 |
| 156 PopupHeaderView::PopupHeaderView(views::ButtonListener* close_button_listener) | 156 PopupHeaderView::PopupHeaderView(views::ButtonListener* close_button_listener) |
| 157 : name_(NULL), status_(NULL) { | 157 : name_(NULL), status_(NULL) { |
| 158 views::GridLayout* layout = new views::GridLayout(this); | 158 views::GridLayout* layout = new views::GridLayout(this); |
| 159 SetLayoutManager(layout); | 159 SetLayoutManager(layout); |
| 160 | 160 |
| 161 const int label_column = 0; | 161 const int label_column = 0; |
| 162 views::ColumnSet* column_set = layout->AddColumnSet(label_column); | 162 views::ColumnSet* column_set = layout->AddColumnSet(label_column); |
| 163 column_set->AddPaddingColumn(0, kHeaderPaddingLeft); | 163 column_set->AddPaddingColumn(0, kHeaderPaddingLeft); |
| 164 column_set->AddColumn(views::GridLayout::FILL, | 164 column_set->AddColumn(views::GridLayout::FILL, |
| 165 views::GridLayout::FILL, | 165 views::GridLayout::FILL, |
| 166 1, | 166 1, |
| 167 views::GridLayout::USE_PREF, | 167 views::GridLayout::USE_PREF, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 | 211 |
| 212 PopupHeaderView::~PopupHeaderView() { | 212 PopupHeaderView::~PopupHeaderView() { |
| 213 } | 213 } |
| 214 | 214 |
| 215 void PopupHeaderView::SetIdentityName(const string16& name) { | 215 void PopupHeaderView::SetIdentityName(const string16& name) { |
| 216 name_->SetText(name); | 216 name_->SetText(name); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void PopupHeaderView::SetIdentityStatus(const string16& status, | 219 void PopupHeaderView::SetIdentityStatus(const string16& status, |
| 220 SkColor text_color) { | 220 SkColor text_color) { |
| 221 status_->SetText(status); | 221 status_->SetText(status); |
| 222 status_->SetEnabledColor(text_color); | 222 status_->SetEnabledColor(text_color); |
| 223 } | 223 } |
| 224 | 224 |
| 225 //////////////////////////////////////////////////////////////////////////////// | 225 //////////////////////////////////////////////////////////////////////////////// |
| 226 // InternalPageInfoPopupView | 226 // InternalPageInfoPopupView |
| 227 //////////////////////////////////////////////////////////////////////////////// | 227 //////////////////////////////////////////////////////////////////////////////// |
| 228 | 228 |
| 229 InternalPageInfoPopupView::InternalPageInfoPopupView(views::View* anchor_view) | 229 InternalPageInfoPopupView::InternalPageInfoPopupView(views::View* anchor_view) |
| 230 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) { | 230 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) { |
| 231 const int kSpacing = 4; | 231 const int kSpacing = 4; |
| 232 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, kSpacing, | 232 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, kSpacing, |
| 233 kSpacing, kSpacing)); | 233 kSpacing, kSpacing)); |
| 234 views::ImageView* icon_view = new views::ImageView(); | 234 views::ImageView* icon_view = new views::ImageView(); |
| 235 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 235 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 236 icon_view->SetImage(rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_26)); | 236 icon_view->SetImage(rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_26)); |
| 237 AddChildView(icon_view); | 237 AddChildView(icon_view); |
| 238 | 238 |
| 239 string16 text = l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE); | 239 views::Label* label = |
| 240 views::Label* label = new views::Label(text); | 240 new views::Label(l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE)); |
| 241 label->SetMultiLine(true); | 241 label->SetMultiLine(true); |
| 242 label->SetAllowCharacterBreak(true); | 242 label->SetAllowCharacterBreak(true); |
| 243 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 243 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
| 244 AddChildView(label); | 244 AddChildView(label); |
| 245 | 245 |
| 246 views::BubbleDelegateView::CreateBubble(this); | 246 views::BubbleDelegateView::CreateBubble(this); |
| 247 Show(); | 247 Show(); |
| 248 SizeToContents(); | 248 SizeToContents(); |
| 249 } | 249 } |
| 250 | 250 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 | 708 |
| 709 if (link) { | 709 if (link) { |
| 710 content_layout->StartRow(1, 0); | 710 content_layout->StartRow(1, 0); |
| 711 content_layout->AddView(link); | 711 content_layout->AddView(link); |
| 712 } | 712 } |
| 713 | 713 |
| 714 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, | 714 layout->AddView(content_pane, 1, 1, views::GridLayout::LEADING, |
| 715 views::GridLayout::LEADING); | 715 views::GridLayout::LEADING); |
| 716 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); | 716 layout->AddPaddingRow(0, kConnectionSectionPaddingBottom); |
| 717 } | 717 } |
| OLD | NEW |