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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 144 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
145 | 145 |
146 StartObserving(); | 146 StartObserving(); |
147 | 147 |
148 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 148 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
149 WebContentsModalDialogManager::FromWebContents(web_contents_); | 149 WebContentsModalDialogManager::FromWebContents(web_contents_); |
150 WebContentsModalDialogManagerDelegate* modal_delegate = | 150 WebContentsModalDialogManagerDelegate* modal_delegate = |
151 web_contents_modal_dialog_manager->delegate(); | 151 web_contents_modal_dialog_manager->delegate(); |
152 DCHECK(modal_delegate); | 152 DCHECK(modal_delegate); |
153 window_ = views::Widget::CreateWindowAsFramelessChild( | 153 window_ = views::Widget::CreateWindowAsFramelessChild( |
154 this, | 154 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
155 web_contents_->GetView()->GetNativeView(), | |
156 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | |
157 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); | 155 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); |
158 | 156 |
159 // Select the first row automatically. This must be done after the dialog has | 157 // Select the first row automatically. This must be done after the dialog has |
160 // been created. | 158 // been created. |
161 table_->Select(0); | 159 table_->Select(0); |
162 } | 160 } |
163 | 161 |
164 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { | 162 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { |
165 int selected = table_->FirstSelectedRow(); | 163 int selected = table_->FirstSelectedRow(); |
166 if (selected >= 0 && | 164 if (selected >= 0 && |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const net::HttpNetworkSession* network_session, | 315 const net::HttpNetworkSession* network_session, |
318 net::SSLCertRequestInfo* cert_request_info, | 316 net::SSLCertRequestInfo* cert_request_info, |
319 const chrome::SelectCertificateCallback& callback) { | 317 const chrome::SelectCertificateCallback& callback) { |
320 DVLOG(1) << __FUNCTION__ << " " << contents; | 318 DVLOG(1) << __FUNCTION__ << " " << contents; |
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 319 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
322 (new SSLClientCertificateSelector( | 320 (new SSLClientCertificateSelector( |
323 contents, network_session, cert_request_info, callback))->Init(); | 321 contents, network_session, cert_request_info, callback))->Init(); |
324 } | 322 } |
325 | 323 |
326 } // namespace chrome | 324 } // namespace chrome |
OLD | NEW |