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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 views::GridLayout::FILL, kTableViewWidth, kTableViewHeight); | 142 views::GridLayout::FILL, kTableViewWidth, kTableViewHeight); |
143 | 143 |
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); | |
msw
2013/11/16 04:15:44
I restored this one too.
| |
153 window_ = views::Widget::CreateWindowAsFramelessChild( | 152 window_ = views::Widget::CreateWindowAsFramelessChild( |
154 this, | 153 this, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); |
155 web_contents_->GetView()->GetNativeView(), | |
156 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); | |
157 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); | 154 web_contents_modal_dialog_manager->ShowDialog(window_->GetNativeView()); |
158 | 155 |
159 // Select the first row automatically. This must be done after the dialog has | 156 // Select the first row automatically. This must be done after the dialog has |
160 // been created. | 157 // been created. |
161 table_->Select(0); | 158 table_->Select(0); |
162 } | 159 } |
163 | 160 |
164 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { | 161 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { |
165 int selected = table_->FirstSelectedRow(); | 162 int selected = table_->FirstSelectedRow(); |
166 if (selected >= 0 && | 163 if (selected >= 0 && |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 const net::HttpNetworkSession* network_session, | 314 const net::HttpNetworkSession* network_session, |
318 net::SSLCertRequestInfo* cert_request_info, | 315 net::SSLCertRequestInfo* cert_request_info, |
319 const chrome::SelectCertificateCallback& callback) { | 316 const chrome::SelectCertificateCallback& callback) { |
320 DVLOG(1) << __FUNCTION__ << " " << contents; | 317 DVLOG(1) << __FUNCTION__ << " " << contents; |
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 318 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
322 (new SSLClientCertificateSelector( | 319 (new SSLClientCertificateSelector( |
323 contents, network_session, cert_request_info, callback))->Init(); | 320 contents, network_session, cert_request_info, callback))->Init(); |
324 } | 321 } |
325 | 322 |
326 } // namespace chrome | 323 } // namespace chrome |
OLD | NEW |