| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/certificate_selector.h" | 5 #include "chrome/browser/ui/views/certificate_selector.h" |
| 6 | 6 |
| 7 #include <stddef.h> // For size_t. | 7 #include <stddef.h> // For size_t. |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } | 256 } |
| 257 | 257 |
| 258 views::View* CertificateSelector::GetInitiallyFocusedView() { | 258 views::View* CertificateSelector::GetInitiallyFocusedView() { |
| 259 DCHECK(table_); | 259 DCHECK(table_); |
| 260 return table_; | 260 return table_; |
| 261 } | 261 } |
| 262 | 262 |
| 263 views::View* CertificateSelector::CreateExtraView() { | 263 views::View* CertificateSelector::CreateExtraView() { |
| 264 DCHECK(!view_cert_button_); | 264 DCHECK(!view_cert_button_); |
| 265 view_cert_button_ = views::MdTextButton::CreateSecondaryUiButton( | 265 view_cert_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 266 this, l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON)); | 266 this, l10n_util::GetStringUTF16(IDS_PAGE_INFO_CERT_INFO_BUTTON)); |
| 267 return view_cert_button_; | 267 return view_cert_button_; |
| 268 } | 268 } |
| 269 | 269 |
| 270 ui::ModalType CertificateSelector::GetModalType() const { | 270 ui::ModalType CertificateSelector::GetModalType() const { |
| 271 return ui::MODAL_TYPE_CHILD; | 271 return ui::MODAL_TYPE_CHILD; |
| 272 } | 272 } |
| 273 | 273 |
| 274 void CertificateSelector::ButtonPressed(views::Button* sender, | 274 void CertificateSelector::ButtonPressed(views::Button* sender, |
| 275 const ui::Event& event) { | 275 const ui::Event& event) { |
| 276 if (sender == view_cert_button_) { | 276 if (sender == view_cert_button_) { |
| 277 net::X509Certificate* const cert = GetSelectedCert(); | 277 net::X509Certificate* const cert = GetSelectedCert(); |
| 278 if (cert) | 278 if (cert) |
| 279 ShowCertificateViewer(web_contents_, | 279 ShowCertificateViewer(web_contents_, |
| 280 web_contents_->GetTopLevelNativeWindow(), cert); | 280 web_contents_->GetTopLevelNativeWindow(), cert); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 void CertificateSelector::OnSelectionChanged() { | 284 void CertificateSelector::OnSelectionChanged() { |
| 285 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr); | 285 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void CertificateSelector::OnDoubleClick() { | 288 void CertificateSelector::OnDoubleClick() { |
| 289 if (GetSelectedCert()) | 289 if (GetSelectedCert()) |
| 290 GetDialogClientView()->AcceptWindow(); | 290 GetDialogClientView()->AcceptWindow(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace chrome | 293 } // namespace chrome |
| OLD | NEW |