| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 147 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 148 WebContentsModalDialogManager::FromWebContents(web_contents_); | 148 WebContentsModalDialogManager::FromWebContents(web_contents_); |
| 149 WebContentsModalDialogManagerDelegate* modal_delegate = | 149 WebContentsModalDialogManagerDelegate* modal_delegate = |
| 150 web_contents_modal_dialog_manager->delegate(); | 150 web_contents_modal_dialog_manager->delegate(); |
| 151 DCHECK(modal_delegate); | 151 DCHECK(modal_delegate); |
| 152 window_ = views::Widget::CreateWindowAsFramelessChild( | 152 window_ = views::Widget::CreateWindowAsFramelessChild( |
| 153 this, | 153 this, |
| 154 web_contents_->GetView()->GetNativeView(), | 154 web_contents_->GetView()->GetNativeView(), |
| 155 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | 155 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
| 156 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); | 156 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); |
| 157 web_contents_modal_dialog_manager->SetCloseOnInterstitialWebUI( |
| 158 window_->GetNativeView(), true); |
| 157 | 159 |
| 158 // Select the first row automatically. This must be done after the dialog has | 160 // Select the first row automatically. This must be done after the dialog has |
| 159 // been created. | 161 // been created. |
| 160 table_->Select(0); | 162 table_->Select(0); |
| 161 } | 163 } |
| 162 | 164 |
| 163 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { | 165 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { |
| 164 int selected = table_->FirstSelectedRow(); | 166 int selected = table_->FirstSelectedRow(); |
| 165 if (selected >= 0 && | 167 if (selected >= 0 && |
| 166 selected < static_cast<int>( | 168 selected < static_cast<int>( |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 const net::HttpNetworkSession* network_session, | 298 const net::HttpNetworkSession* network_session, |
| 297 net::SSLCertRequestInfo* cert_request_info, | 299 net::SSLCertRequestInfo* cert_request_info, |
| 298 const chrome::SelectCertificateCallback& callback) { | 300 const chrome::SelectCertificateCallback& callback) { |
| 299 DVLOG(1) << __FUNCTION__ << " " << contents; | 301 DVLOG(1) << __FUNCTION__ << " " << contents; |
| 300 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 302 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 301 (new SSLClientCertificateSelector( | 303 (new SSLClientCertificateSelector( |
| 302 contents, network_session, cert_request_info, callback))->Init(); | 304 contents, network_session, cert_request_info, callback))->Init(); |
| 303 } | 305 } |
| 304 | 306 |
| 305 } // namespace chrome | 307 } // namespace chrome |
| OLD | NEW |