| 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/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ui/views/ssl_client_certificate_selector.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 StartObserving(); | 149 StartObserving(); |
| 150 | 150 |
| 151 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 151 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 152 WebContentsModalDialogManager::FromWebContents(web_contents_); | 152 WebContentsModalDialogManager::FromWebContents(web_contents_); |
| 153 WebContentsModalDialogManagerDelegate* modal_delegate = | 153 WebContentsModalDialogManagerDelegate* modal_delegate = |
| 154 web_contents_modal_dialog_manager->delegate(); | 154 web_contents_modal_dialog_manager->delegate(); |
| 155 DCHECK(modal_delegate); | 155 DCHECK(modal_delegate); |
| 156 window_ = views::Widget::CreateWindowAsFramelessChild( | 156 window_ = views::Widget::CreateWindowAsFramelessChild( |
| 157 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 157 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 158 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); | 158 web_contents_modal_dialog_manager->ShowWebModalDialog( |
| 159 window_->GetNativeView()); |
| 159 | 160 |
| 160 // Select the first row automatically. This must be done after the dialog has | 161 // Select the first row automatically. This must be done after the dialog has |
| 161 // been created. | 162 // been created. |
| 162 table_->Select(0); | 163 table_->Select(0); |
| 163 } | 164 } |
| 164 | 165 |
| 165 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { | 166 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { |
| 166 int selected = table_->FirstSelectedRow(); | 167 int selected = table_->FirstSelectedRow(); |
| 167 if (selected >= 0 && | 168 if (selected >= 0 && |
| 168 selected < static_cast<int>( | 169 selected < static_cast<int>( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 const net::HttpNetworkSession* network_session, | 309 const net::HttpNetworkSession* network_session, |
| 309 net::SSLCertRequestInfo* cert_request_info, | 310 net::SSLCertRequestInfo* cert_request_info, |
| 310 const chrome::SelectCertificateCallback& callback) { | 311 const chrome::SelectCertificateCallback& callback) { |
| 311 DVLOG(1) << __FUNCTION__ << " " << contents; | 312 DVLOG(1) << __FUNCTION__ << " " << contents; |
| 312 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 313 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 313 (new SSLClientCertificateSelector( | 314 (new SSLClientCertificateSelector( |
| 314 contents, network_session, cert_request_info, callback))->Init(); | 315 contents, network_session, cert_request_info, callback))->Init(); |
| 315 } | 316 } |
| 316 | 317 |
| 317 } // namespace chrome | 318 } // namespace chrome |
| OLD | NEW |