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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 layout->AddView(table_->CreateParentIfNecessary(), 1, 1, | 133 layout->AddView(table_->CreateParentIfNecessary(), 1, 1, |
134 views::GridLayout::FILL, | 134 views::GridLayout::FILL, |
135 views::GridLayout::FILL, kTableViewWidth, kTableViewHeight); | 135 views::GridLayout::FILL, kTableViewWidth, kTableViewHeight); |
136 | 136 |
137 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 137 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
138 | 138 |
139 CreateViewCertButton(); | 139 CreateViewCertButton(); |
140 | 140 |
141 StartObserving(); | 141 StartObserving(); |
142 | 142 |
143 window_ = new ConstrainedWindowViews(tab_contents_->web_contents(), | 143 window_ = new ConstrainedWindowViews( |
144 this, | 144 tab_contents_->web_contents(), this, false, |
145 false); | 145 ConstrainedWindowViews::DEFAULT_INSETS); |
146 | 146 |
147 // Select the first row automatically. This must be done after the dialog has | 147 // Select the first row automatically. This must be done after the dialog has |
148 // been created. | 148 // been created. |
149 table_->Select(0); | 149 table_->Select(0); |
150 } | 150 } |
151 | 151 |
152 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { | 152 net::X509Certificate* SSLClientCertificateSelector::GetSelectedCert() const { |
153 int selected = table_->FirstSelectedRow(); | 153 int selected = table_->FirstSelectedRow(); |
154 if (selected >= 0 && | 154 if (selected >= 0 && |
155 selected < static_cast<int>( | 155 selected < static_cast<int>( |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 net::SSLCertRequestInfo* cert_request_info, | 289 net::SSLCertRequestInfo* cert_request_info, |
290 const base::Callback<void(net::X509Certificate*)>& callback) { | 290 const base::Callback<void(net::X509Certificate*)>& callback) { |
291 DVLOG(1) << __FUNCTION__ << " " << contents; | 291 DVLOG(1) << __FUNCTION__ << " " << contents; |
292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
293 TabContents* tab_contents = TabContents::FromWebContents(contents); | 293 TabContents* tab_contents = TabContents::FromWebContents(contents); |
294 (new SSLClientCertificateSelector( | 294 (new SSLClientCertificateSelector( |
295 tab_contents, network_session, cert_request_info, callback))->Init(); | 295 tab_contents, network_session, cert_request_info, callback))->Init(); |
296 } | 296 } |
297 | 297 |
298 } // namespace chrome | 298 } // namespace chrome |
OLD | NEW |