| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/certificate_selector.h" | 5 #include "chrome/browser/ui/views/certificate_selector.h" |
| 6 | 6 |
| 7 #include <stddef.h> // For size_t. | 7 #include <stddef.h> // For size_t. |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 191 } |
| 192 | 192 |
| 193 // Select the first row automatically. This must be done after the dialog has | 193 // Select the first row automatically. This must be done after the dialog has |
| 194 // been created. | 194 // been created. |
| 195 table_->Select(0); | 195 table_->Select(0); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void CertificateSelector::InitWithText( | 198 void CertificateSelector::InitWithText( |
| 199 std::unique_ptr<views::View> text_label) { | 199 std::unique_ptr<views::View> text_label) { |
| 200 views::GridLayout* const layout = views::GridLayout::CreatePanel(this); | 200 views::GridLayout* const layout = views::GridLayout::CreatePanel(this); |
| 201 SetLayoutManager(layout); | |
| 202 | 201 |
| 203 const int kColumnSetId = 0; | 202 const int kColumnSetId = 0; |
| 204 views::ColumnSet* const column_set = layout->AddColumnSet(kColumnSetId); | 203 views::ColumnSet* const column_set = layout->AddColumnSet(kColumnSetId); |
| 205 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 204 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 206 views::GridLayout::USE_PREF, 0, 0); | 205 views::GridLayout::USE_PREF, 0, 0); |
| 207 | 206 |
| 208 layout->StartRow(0, kColumnSetId); | 207 layout->StartRow(0, kColumnSetId); |
| 209 layout->AddView(text_label.release()); | 208 layout->AddView(text_label.release()); |
| 210 | 209 |
| 211 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 210 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 void CertificateSelector::OnSelectionChanged() { | 284 void CertificateSelector::OnSelectionChanged() { |
| 286 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr); | 285 GetDialogClientView()->ok_button()->SetEnabled(GetSelectedCert() != nullptr); |
| 287 } | 286 } |
| 288 | 287 |
| 289 void CertificateSelector::OnDoubleClick() { | 288 void CertificateSelector::OnDoubleClick() { |
| 290 if (GetSelectedCert()) | 289 if (GetSelectedCert()) |
| 291 GetDialogClientView()->AcceptWindow(); | 290 GetDialogClientView()->AcceptWindow(); |
| 292 } | 291 } |
| 293 | 292 |
| 294 } // namespace chrome | 293 } // namespace chrome |
| OLD | NEW |