| 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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return cert_request_info()->client_certs[selected]; | 156 return cert_request_info()->client_certs[selected]; |
| 157 return NULL; | 157 return NULL; |
| 158 } | 158 } |
| 159 | 159 |
| 160 /////////////////////////////////////////////////////////////////////////////// | 160 /////////////////////////////////////////////////////////////////////////////// |
| 161 // SSLClientAuthObserver implementation: | 161 // SSLClientAuthObserver implementation: |
| 162 | 162 |
| 163 void SSLClientCertificateSelector::OnCertSelectedByNotification() { | 163 void SSLClientCertificateSelector::OnCertSelectedByNotification() { |
| 164 DVLOG(1) << __FUNCTION__; | 164 DVLOG(1) << __FUNCTION__; |
| 165 DCHECK(window_); | 165 DCHECK(window_); |
| 166 window_->CloseConstrainedWindow(); | 166 window_->CloseWebContentsModalDialog(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 /////////////////////////////////////////////////////////////////////////////// | 169 /////////////////////////////////////////////////////////////////////////////// |
| 170 // DialogDelegateView implementation: | 170 // DialogDelegateView implementation: |
| 171 | 171 |
| 172 bool SSLClientCertificateSelector::CanResize() const { | 172 bool SSLClientCertificateSelector::CanResize() const { |
| 173 return true; | 173 return true; |
| 174 } | 174 } |
| 175 | 175 |
| 176 string16 SSLClientCertificateSelector::GetWindowTitle() const { | 176 string16 SSLClientCertificateSelector::GetWindowTitle() const { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 /////////////////////////////////////////////////////////////////////////////// | 246 /////////////////////////////////////////////////////////////////////////////// |
| 247 // views::TableViewObserver implementation: | 247 // views::TableViewObserver implementation: |
| 248 void SSLClientCertificateSelector::OnSelectionChanged() { | 248 void SSLClientCertificateSelector::OnSelectionChanged() { |
| 249 GetDialogClientView()->ok_button()->SetEnabled(!!GetSelectedCert()); | 249 GetDialogClientView()->ok_button()->SetEnabled(!!GetSelectedCert()); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void SSLClientCertificateSelector::OnDoubleClick() { | 252 void SSLClientCertificateSelector::OnDoubleClick() { |
| 253 if (Accept()) | 253 if (Accept()) |
| 254 window_->CloseConstrainedWindow(); | 254 window_->CloseWebContentsModalDialog(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 /////////////////////////////////////////////////////////////////////////////// | 257 /////////////////////////////////////////////////////////////////////////////// |
| 258 // SSLClientCertificateSelector private methods: | 258 // SSLClientCertificateSelector private methods: |
| 259 | 259 |
| 260 void SSLClientCertificateSelector::CreateCertTable() { | 260 void SSLClientCertificateSelector::CreateCertTable() { |
| 261 std::vector<ui::TableColumn> columns; | 261 std::vector<ui::TableColumn> columns; |
| 262 columns.push_back(ui::TableColumn()); | 262 columns.push_back(ui::TableColumn()); |
| 263 table_ = new views::TableView(model_.get(), | 263 table_ = new views::TableView(model_.get(), |
| 264 columns, | 264 columns, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 294 const net::HttpNetworkSession* network_session, | 294 const net::HttpNetworkSession* network_session, |
| 295 net::SSLCertRequestInfo* cert_request_info, | 295 net::SSLCertRequestInfo* cert_request_info, |
| 296 const chrome::SelectCertificateCallback& callback) { | 296 const chrome::SelectCertificateCallback& callback) { |
| 297 DVLOG(1) << __FUNCTION__ << " " << contents; | 297 DVLOG(1) << __FUNCTION__ << " " << contents; |
| 298 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 298 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 299 (new SSLClientCertificateSelector( | 299 (new SSLClientCertificateSelector( |
| 300 contents, network_session, cert_request_info, callback))->Init(); | 300 contents, network_session, cert_request_info, callback))->Init(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace chrome | 303 } // namespace chrome |
| OLD | NEW |