| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signed_certificate_timestamps_views.h" | 5 #include "chrome/browser/ui/views/signed_certificate_timestamps_views.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 void SignedCertificateTimestampsViews::OnPerformAction( | 116 void SignedCertificateTimestampsViews::OnPerformAction( |
| 117 views::Combobox* combobox) { | 117 views::Combobox* combobox) { |
| 118 DCHECK_EQ(combobox, sct_selector_box_.get()); | 118 DCHECK_EQ(combobox, sct_selector_box_.get()); |
| 119 DCHECK_LT(combobox->selected_index(), sct_list_model_->GetItemCount()); | 119 DCHECK_LT(combobox->selected_index(), sct_list_model_->GetItemCount()); |
| 120 ShowSCTInfo(combobox->selected_index()); | 120 ShowSCTInfo(combobox->selected_index()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void SignedCertificateTimestampsViews::ViewHierarchyChanged( | 123 void SignedCertificateTimestampsViews::ViewHierarchyChanged( |
| 124 const ViewHierarchyChangedDetails& details) { | 124 const ViewHierarchyChangedDetails& details) { |
| 125 views::DialogDelegateView::ViewHierarchyChanged(details); |
| 125 if (details.is_add && details.child == this) | 126 if (details.is_add && details.child == this) |
| 126 Init(); | 127 Init(); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void SignedCertificateTimestampsViews::Init() { | 130 void SignedCertificateTimestampsViews::Init() { |
| 130 views::GridLayout* layout = views::GridLayout::CreatePanel(this); | 131 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
| 131 SetLayoutManager(layout); | 132 SetLayoutManager(layout); |
| 132 | 133 |
| 133 const int kSelectorBoxLayoutId = 0; | 134 const int kSelectorBoxLayoutId = 0; |
| 134 views::ColumnSet* column_set = layout->AddColumnSet(kSelectorBoxLayoutId); | 135 views::ColumnSet* column_set = layout->AddColumnSet(kSelectorBoxLayoutId); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 163 sct_info_view_->SetSignedCertificateTimestamp( | 164 sct_info_view_->SetSignedCertificateTimestamp( |
| 164 *(sct_list_[sct_index].sct.get()), sct_list_[sct_index].status); | 165 *(sct_list_[sct_index].sct.get()), sct_list_[sct_index].status); |
| 165 } | 166 } |
| 166 | 167 |
| 167 void SignedCertificateTimestampsViews::Observe( | 168 void SignedCertificateTimestampsViews::Observe( |
| 168 int type, | 169 int type, |
| 169 const content::NotificationSource& source, | 170 const content::NotificationSource& source, |
| 170 const content::NotificationDetails& details) { | 171 const content::NotificationDetails& details) { |
| 171 GetWidget()->Close(); | 172 GetWidget()->Close(); |
| 172 } | 173 } |
| OLD | NEW |